Fix initial sort order
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 Sep 2024 15:29:04 +0000 (17:29 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 12 Nov 2024 11:51:53 +0000 (12:51 +0100)
wcfsetup/install/files/lib/page/AbstractGridViewPage.class.php

index 78dbb60b4dd5eca2e258fd213622d89497882f81..0db619758382b4e746ca838df1c25ce0cf0d741f 100644 (file)
@@ -11,7 +11,7 @@ abstract class AbstractGridViewPage extends AbstractPage
     protected AbstractGridView $gridView;
     protected int $pageNo = 1;
     protected string $sortField = '';
-    protected string $sortOrder = 'ASC';
+    protected string $sortOrder = '';
 
     #[\Override]
     public function readParameters()
@@ -54,7 +54,9 @@ abstract class AbstractGridViewPage extends AbstractPage
         if ($this->sortField) {
             $this->gridView->setSortField($this->sortField);
         }
-        $this->gridView->setSortOrder($this->sortOrder);
+        if ($this->sortOrder) {
+            $this->gridView->setSortOrder($this->sortOrder);
+        }
         $this->gridView->setPageNo($this->pageNo);
         $this->gridView->setBaseUrl(LinkHandler::getInstance()->getControllerLink(static::class));
     }