From: Tim Düsterhus Date: Sun, 10 Apr 2016 13:15:19 +0000 (+0200) Subject: Fix Page::setAsLandingPage() X-Git-Tag: 3.0.0_Beta_1~1937 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=289f37963694a034cf520300798f1d134685d46b;p=GitHub%2FWoltLab%2FWCF.git Fix Page::setAsLandingPage() see a80873d5fe45732dd39a51a89f6f58a91656fc50 --- diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index c56bbb6716..739f3f0f4d 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -213,14 +213,13 @@ class Page extends DatabaseObject { throw new SystemException('Pages requiring an object id cannot be set as landing page.'); } + WCF::getDB()->beginTransaction(); // unmark existing landing page $sql = "UPDATE wcf".WCF_N."_page - SET isLandingPage = ? - AND isLandingPage = ?"; + SET isLandingPage = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ - 0, - 1 + 0 ]); // set current page as landing page @@ -232,6 +231,7 @@ class Page extends DatabaseObject { 1, $this->pageID ]); + WCF::getDB()->commitTransaction(); } /**