From a0621f1304ae438ccb11af63fbc1230199c98be7 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 18 Aug 2023 13:51:05 +0200 Subject: [PATCH] Fall back to plain value if the i18n values are missing Fixes #5622 --- .../system/form/builder/field/TI18nFormField.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TI18nFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TI18nFormField.class.php index 33487ed6b3..dc3d4244d0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TI18nFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TI18nFormField.class.php @@ -373,7 +373,14 @@ trait TI18nFormField $values[$languageItem->languageID] = $languageItem->languageItemValue; } - I18nHandler::getInstance()->setValues($this->getPrefixedId(), $values); + if ($values === []) { + // The value should be an i18n value but the phrases are missing + // for an unknown reason. Recovery by forcing the value to be + // treated as plain text. See https://github.com/WoltLab/WCF/issues/5622 + I18nHandler::getInstance()->setValue($this->getPrefixedId(), $value, true); + } else { + I18nHandler::getInstance()->setValues($this->getPrefixedId(), $values); + } } else { I18nHandler::getInstance()->setValue($this->getPrefixedId(), $value, !$this->isI18nRequired()); } -- 2.20.1