From 386e9a0143ed88d8d37c0631c2adbb0f05ed3409 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 11 Oct 2011 19:49:24 +0200 Subject: [PATCH] Fixed sort handling in MultipleLinkPage --- .../install/files/lib/page/MultipleLinkPage.class.php | 3 +-- wcfsetup/install/files/lib/page/SortablePage.class.php | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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. */ -- 2.20.1