From: Marcel Werk Date: Tue, 11 Oct 2016 22:15:00 +0000 (+0200) Subject: Fixed empty box names X-Git-Tag: 3.0.0_Beta_3~50^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2dd2e0fe49af219ba80ff8ed754ee70734eeba41;p=GitHub%2FWoltLab%2FWCF.git Fixed empty box names --- diff --git a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php index 0059cd05d0..d263dacc3f 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php @@ -8,6 +8,7 @@ use wcf\form\AbstractForm; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; +use wcf\system\language\LanguageFactory; use wcf\system\WCF; use wcf\util\ArrayUtil; use wcf\util\StringUtil; @@ -151,13 +152,19 @@ class MenuAddForm extends AbstractForm { public function save() { parent::save(); + $boxName = $this->title; + if (!I18nHandler::getInstance()->isPlainValue('title')) { + $values = I18nHandler::getInstance()->getValues('title'); + $boxName = $values[LanguageFactory::getInstance()->getDefaultLanguageID()]; + } + // save label $this->objectAction = new MenuAction([], 'create', ['data' => array_merge($this->additionalFields, [ 'title' => $this->title, 'packageID' => 1, 'identifier' => '' ]), 'boxData' => [ - 'name' => $this->title, + 'name' => $boxName, 'boxType' => 'menu', 'position' => $this->position, 'visibleEverywhere' => $this->visibleEverywhere ? 1 : 0, diff --git a/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php index 7b88d133de..2ce3e8b017 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php @@ -6,6 +6,7 @@ use wcf\data\menu\MenuAction; use wcf\form\AbstractForm; use wcf\system\exception\IllegalLinkException; use wcf\system\language\I18nHandler; +use wcf\system\language\LanguageFactory; use wcf\system\WCF; /** @@ -62,7 +63,13 @@ class MenuEditForm extends MenuAddForm { */ public function save() { AbstractForm::save(); - + + $boxName = $this->title; + if (!I18nHandler::getInstance()->isPlainValue('title')) { + $values = I18nHandler::getInstance()->getValues('title'); + $boxName = $values[LanguageFactory::getInstance()->getDefaultLanguageID()]; + } + $this->title = 'wcf.menu.menu'.$this->menu->menuID; if (I18nHandler::getInstance()->isPlainValue('title')) { I18nHandler::getInstance()->remove($this->title); @@ -85,7 +92,8 @@ class MenuEditForm extends MenuAddForm { 'visibleEverywhere' => $this->visibleEverywhere ? 1 : 0, 'showHeader' => $this->showHeader ? 1 : 0, 'showOrder' => $this->showOrder, - 'cssClassName' => $this->cssClassName + 'cssClassName' => $this->cssClassName, + 'name' => $boxName ]), 'pageIDs' => $this->pageIDs]); $boxAction->executeAction(); }