From: Marcel Werk Date: Tue, 11 Oct 2011 17:49:24 +0000 (+0200) Subject: Fixed sort handling in MultipleLinkPage X-Git-Tag: 2.0.0_Beta_1~1712^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=386e9a0143ed88d8d37c0631c2adbb0f05ed3409;p=GitHub%2FWoltLab%2FWCF.git Fixed sort handling in MultipleLinkPage --- diff --git a/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php b/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php index 4cb015d98f..a35119e1a7 100644 --- a/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php +++ b/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php @@ -106,7 +106,6 @@ abstract class MultipleLinkPage extends AbstractPage { if ($this->items) { $this->sqlLimit = $this->itemsPerPage; $this->sqlOffset = ($this->pageNo - 1) * $this->itemsPerPage; - $this->sqlOrderBy = $this->sortField." ".$this->sortOrder; $this->readObjects(); } } @@ -132,7 +131,7 @@ abstract class MultipleLinkPage extends AbstractPage { protected function readObjects() { $this->objectList->sqlLimit = $this->sqlLimit; $this->objectList->sqlOffset = $this->sqlOffset; - $this->objectList->sqlOrderBy = $this->sqlOrderBy; + if ($this->sqlOrderBy) $this->objectList->sqlOrderBy = $this->sqlOrderBy; $this->objectList->readObjects(); } diff --git a/wcfsetup/install/files/lib/page/SortablePage.class.php b/wcfsetup/install/files/lib/page/SortablePage.class.php index c9c09f4a10..433afd190b 100644 --- a/wcfsetup/install/files/lib/page/SortablePage.class.php +++ b/wcfsetup/install/files/lib/page/SortablePage.class.php @@ -66,6 +66,15 @@ abstract class SortablePage extends MultipleLinkPage { parent::readData(); } + /** + * @see wcf\page\MultipleLinkPage::readObjects() + */ + protected function readObjects() { + $this->sqlOrderBy = $this->sortField." ".$this->sortOrder; + + parent::readObjects(); + } + /** * Validates the given sort field parameter. */