From 289f37963694a034cf520300798f1d134685d46b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 10 Apr 2016 15:15:19 +0200 Subject: [PATCH] Fix Page::setAsLandingPage() see a80873d5fe45732dd39a51a89f6f58a91656fc50 --- wcfsetup/install/files/lib/data/page/Page.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(); } /** -- 2.20.1