return $list;
}, false, false)
+ ->required()
->filterable(),
TextFormField::create('languageItem')
/** @var SingleSelectionFormField $languageCategoryID */
$languageCategoryID = $formField->getDocument()->getNodeById('languageCategoryID');
- $languageCategory = LanguageFactory::getInstance()->getCategoryByID($languageCategoryID->getSaveValue());
-
- if (strpos($formField->getSaveValue(), $languageCategory->languageCategory) . '.' !== 0) {
- $formField->addValidationError(
- new FormFieldValidationError(
- 'prefixMismatch',
- 'wcf.acp.language.item.languageItem.error.prefixMismatch'
- )
- );
+ if ($languageCategory = LanguageFactory::getInstance()->getCategoryByID($languageCategoryID->getSaveValue())) {
+ if (strpos($formField->getSaveValue(), $languageCategory->languageCategory . '.') !== 0) {
+ $formField->addValidationError(
+ new FormFieldValidationError(
+ 'prefixMismatch',
+ 'wcf.acp.language.item.languageItem.error.prefixMismatch'
+ )
+ );
+ }
}
break;