Expand non-i18n value for system-type boxes
authorAlexander Ebert <ebert@woltlab.com>
Tue, 30 Jan 2018 11:34:03 +0000 (12:34 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 30 Jan 2018 11:34:03 +0000 (12:34 +0100)
wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php

index 6d390aac333c0c1dcf823d59c3c44d65028abdb1..32821ae57c42126f32a238cae3e31385e78308b1 100644 (file)
@@ -317,6 +317,20 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                        foreach ($this->content as $boxID => $contentData) {
                                $boxEditor = $this->boxes[$boxID];
                                
+                               // expand non-i18n value
+                               if ($boxEditor->boxType === 'system' && count($contentData) === 1 && isset($contentData[''])) {
+                                       foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+                                               $insertStatement->execute([
+                                                       $boxID,
+                                                       $language->languageID,
+                                                       $contentData['']['title'],
+                                                       ''
+                                               ]);
+                                       }
+                                       
+                                       continue;
+                               }
+                               
                                foreach ($contentData as $languageCode => $content) {
                                        $languageID = null;
                                        if ($languageCode != '') {