From: Matthias Schmidt Date: Sun, 5 Jan 2014 21:18:36 +0000 (+0100) Subject: Fixes languageCustomItemValue for "reseted" language items X-Git-Tag: 2.0.2~31^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76899d182b1dff5f82c9f632d6ace3aaf99c085c;p=GitHub%2FWoltLab%2FWCF.git Fixes languageCustomItemValue for "reseted" language items If you use a custom version of language item, but don't want to use it anymore and don't want the custom version to be saved, you uncheck the "Use custom value" checkbox and leave the "Custom Value" textarea empty. This is the same state as the state of a never edited language item which is why the `languageCustomItemValue` value of the previously customized language item has to be `NULL` as it is for the never edited language item. This fixes the number of custom phrases in the language table of LanguageListPage which currently counts all language items which ever had a custom value. --- diff --git a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php index 793c5b839b..4ba38efe84 100644 --- a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php +++ b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php @@ -97,7 +97,7 @@ class LanguageItemAction extends AbstractDatabaseObjectAction { $editor = reset($this->objects); if ($editor->languageItemOriginIsSystem) { $updateData = array( - 'languageCustomItemValue' => $this->parameters['languageCustomItemValue'], + 'languageCustomItemValue' => !$this->parameters['languageUseCustomValue'] && empty($this->parameters['languageCustomItemValue']) ? null : $this->parameters['languageCustomItemValue'], 'languageUseCustomValue' => ($this->parameters['languageUseCustomValue'] ? 1 : 0) ); }