Fixed sort handling in MultipleLinkPage
authorMarcel Werk <burntime@woltlab.com>
Tue, 11 Oct 2011 17:49:24 +0000 (19:49 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 11 Oct 2011 17:49:24 +0000 (19:49 +0200)
wcfsetup/install/files/lib/page/MultipleLinkPage.class.php
wcfsetup/install/files/lib/page/SortablePage.class.php

index 4cb015d98f8707c77438fc9169d1bae9ab00919b..a35119e1a7bedf19c5ea79205650498ca0df1cf9 100644 (file)
@@ -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();
        }
        
index c9c09f4a104d81eefd4a4eb432a1aca6bf35ac79..433afd190b484bdfd7e51acbf4e4f07551bf14bc 100644 (file)
@@ -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. 
         */