Fix sorting of articles by number of comments
authorMarcel Werk <burntime@woltlab.com>
Mon, 27 Jun 2022 16:04:37 +0000 (18:04 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 27 Jun 2022 16:04:37 +0000 (18:04 +0200)
Sorting by comments resulted in an exception because the comments column is no longer present in the article table.

wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php

index 44f5494b1fcaf566080a34dc0e925a1aeae0e05d..ed0b49d5ecfd6e2854c704bfed75b7041d2a075c 100644 (file)
@@ -49,7 +49,6 @@ class ArticleListBoxController extends AbstractDatabaseObjectListBoxController
      */
     public $validSortFields = [
         'time',
-        'comments',
         'views',
         'random',
     ];
@@ -74,9 +73,6 @@ class ArticleListBoxController extends AbstractDatabaseObjectListBoxController
         $objectList = new AccessibleArticleList();
 
         switch ($this->sortField) {
-            case 'comments':
-                $objectList->getConditionBuilder()->add('article.comments > ?', [0]);
-                break;
             case 'views':
                 $objectList->getConditionBuilder()->add('article.views > ?', [0]);
                 break;