From: Marcel Werk Date: Tue, 11 Oct 2016 15:31:16 +0000 (+0200) Subject: Fixed update of box to page assignments X-Git-Tag: 3.0.0_Beta_3~50^2~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f56ab669ef428cc3b431a4d2d9760940331d17f2;p=GitHub%2FWoltLab%2FWCF.git Fixed update of box to page assignments --- diff --git a/wcfsetup/install/files/lib/data/page/PageAction.class.php b/wcfsetup/install/files/lib/data/page/PageAction.class.php index 06339b6f81..3a85816b2e 100644 --- a/wcfsetup/install/files/lib/data/page/PageAction.class.php +++ b/wcfsetup/install/files/lib/data/page/PageAction.class.php @@ -191,7 +191,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, } // save box to page assignments - if (!empty($this->parameters['boxToPage'])) { + if (isset($this->parameters['boxToPage'])) { $sql = "DELETE FROM wcf".WCF_N."_box_to_page WHERE pageID = ?"; $deleteStatement = WCF::getDB()->prepareStatement($sql); @@ -204,13 +204,15 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, foreach ($this->getObjects() as $page) { $deleteStatement->execute([$page->pageID]); - foreach ($this->parameters['boxToPage'] as $boxData) { - $insertStatement->execute([ - $boxData['boxID'], - $page->pageID, - $boxData['visible'] - ]); - } + if (!empty($this->parameters['boxToPage'])) { + foreach ($this->parameters['boxToPage'] as $boxData) { + $insertStatement->execute([ + $boxData['boxID'], + $page->pageID, + $boxData['visible'] + ]); + } + } } } }