Fixed multiple issues in box management
authorMarcel Werk <burntime@woltlab.com>
Fri, 8 Apr 2016 14:23:10 +0000 (16:23 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 8 Apr 2016 14:23:10 +0000 (16:23 +0200)
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php
wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php
wcfsetup/install/files/lib/data/box/BoxAction.class.php

index cc867941e66b479e0b4955e82d30f973b744b403..35c5889e77c4b1cc2a9e1bff50ff246c6c8abed5 100644 (file)
@@ -135,7 +135,7 @@ class BoxAddForm extends AbstractForm {
        public function readFormParameters() {
                parent::readFormParameters();
                
-               $this->visibleEverywhere = $this->showOrder = 0;
+               $this->visibleEverywhere = $this->showHeader = $this->showOrder = 0;
                if (isset($_POST['name'])) $this->name = StringUtil::trim($_POST['name']);
                if (isset($_POST['boxType'])) $this->boxType = $_POST['boxType'];
                if (isset($_POST['position'])) $this->position = $_POST['position'];
index 3d3a07c8e2add7245df28be72d42f464eff20821..68e9c3ad35b35d9c31db848c8a322fa132d7a527 100644 (file)
@@ -95,7 +95,7 @@ class MenuAddForm extends AbstractForm {
                
                if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title');
                
-               $this->visibleEverywhere = $this->showOrder = 0;
+               $this->visibleEverywhere = $this->showHeader = $this->showOrder = 0;
                if (isset($_POST['position'])) $this->position = $_POST['position'];
                if (isset($_POST['showOrder'])) $this->showOrder = intval($_POST['showOrder']);
                if (isset($_POST['visibleEverywhere'])) $this->visibleEverywhere = intval($_POST['visibleEverywhere']);
index 389451200ba4a3a5971f9ad4a292dd3dc1712e99..19a91cc33b93c1d2718fcf10363efb3305006c80 100644 (file)
@@ -129,9 +129,10 @@ class BoxAction extends AbstractDatabaseObjectAction {
                        
                        foreach ($this->objects as $box) {
                                $deleteStatement->execute([$box->boxID]);
+                               $visibleEverywhere = (isset($this->parameters['data']['visibleEverywhere']) ? $this->parameters['data']['visibleEverywhere'] : $box->visibleEverywhere);
                                
                                foreach ($this->parameters['pageIDs'] as $pageID) {
-                                       $insertStatement->execute([$box->boxID, $pageID, ($box->visibleEverywhere ? 0 : 1)]);
+                                       $insertStatement->execute([$box->boxID, $pageID, ($visibleEverywhere ? 0 : 1)]);
                                }
                        }
                }