Store deterministic language variable for style description in StyleEditForm
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 Aug 2021 12:12:42 +0000 (14:12 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 Aug 2021 12:14:03 +0000 (14:14 +0200)
If the `styleDescription` was empty (as it might be for the default style) this
attempted to store the description in the language item with empty name.

wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php

index a117ce69be8e166d7ac871f301a7e69f060deb0a..40f1dcb3f5abf669d4d9a0f31b43577c343bf2fd 100644 (file)
@@ -4,6 +4,7 @@ namespace wcf\acp\form;
 
 use wcf\data\style\Style;
 use wcf\data\style\StyleAction;
+use wcf\data\style\StyleEditor;
 use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\UserInputException;
@@ -346,7 +347,16 @@ class StyleEditForm extends StyleAddForm
         }
 
         // save description
-        I18nHandler::getInstance()->save('styleDescription', $this->style->styleDescription, 'wcf.style');
+        I18nHandler::getInstance()->save(
+            'styleDescription',
+            'wcf.style.styleDescription' . $this->style->styleID,
+            'wcf.style'
+        );
+
+        $styleEditor = new StyleEditor($this->style);
+        $styleEditor->update([
+            'styleDescription' => 'wcf.style.styleDescription' . $this->style->styleID,
+        ]);
 
         // call saved event
         $this->saved();