From: Marcel Werk Date: Tue, 11 Oct 2011 18:49:15 +0000 (+0200) Subject: Fixed sort handling in MultipleLinkPage X-Git-Tag: 2.0.0_Beta_1~1699^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03935e3abcee65bd82fc197e724c98b6d4b4591f;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 a35119e1a7..42656d01af 100644 --- a/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php +++ b/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php @@ -65,6 +65,18 @@ abstract class MultipleLinkPage extends AbstractPage { */ public $objectListClassName = ''; + /** + * selected sort field + * @var string + */ + public $sortField = ''; + + /** + * selected sort order + * @var string + */ + public $sortOrder = ''; + /** * @see wcf\data\DatabaseObjectList::$sqlLimit */ @@ -106,6 +118,7 @@ abstract class MultipleLinkPage extends AbstractPage { if ($this->items) { $this->sqlLimit = $this->itemsPerPage; $this->sqlOffset = ($this->pageNo - 1) * $this->itemsPerPage; + if ($this->sortField && $this->sortOrder) $this->sqlOrderBy = $this->sortField." ".$this->sortOrder; $this->readObjects(); } } diff --git a/wcfsetup/install/files/lib/page/SortablePage.class.php b/wcfsetup/install/files/lib/page/SortablePage.class.php index 433afd190b..ee3169d742 100644 --- a/wcfsetup/install/files/lib/page/SortablePage.class.php +++ b/wcfsetup/install/files/lib/page/SortablePage.class.php @@ -15,18 +15,6 @@ use wcf\system\event\EventHandler; * @category Community Framework */ abstract class SortablePage extends MultipleLinkPage { - /** - * selected sort field - * @var string - */ - public $sortField = ''; - - /** - * selected sort order - * @var string - */ - public $sortOrder = ''; - /** * default sort field * @var string @@ -66,15 +54,6 @@ 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. */