Clear old phrase when re-enabling custom value
authorAlexander Ebert <ebert@woltlab.com>
Thu, 16 Mar 2017 13:05:33 +0000 (14:05 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 16 Mar 2017 13:05:38 +0000 (14:05 +0100)
See #2221

wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php

index 4dc6fcc1120273e0691f47f5b70827f3895a7beb..11d9cd7849c98442d091e30ef722f38e3cbfdcea 100644 (file)
@@ -102,6 +102,11 @@ class LanguageItemAction extends AbstractDatabaseObjectAction {
                                'languageCustomItemValue' => !$this->parameters['languageUseCustomValue'] && empty($this->parameters['languageCustomItemValue']) ? null : $this->parameters['languageCustomItemValue'],
                                'languageUseCustomValue' => $this->parameters['languageUseCustomValue'] ? 1 : 0
                        ];
+                       
+                       if ($this->parameters['languageUseCustomValue']) {
+                               $updateData['languageItemOldValue'] = null;
+                               $updateData['languageCustomItemDisableTime'] = null;
+                       }
                }
                else {
                        $updateData = [