vB5: Take `channel.category` into account when deciding on the boardType
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 30 Jun 2022 14:12:04 +0000 (16:12 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 30 Jun 2022 14:38:34 +0000 (16:38 +0200)
Apparently newer vBulletin 5 versions no longer set the `CANCONTAINTHREADS` bit
in channel options.

files/lib/system/exporter/VB5xExporter.class.php

index 048f0f48fc38de1679d27ecc5d4a6e12d95b4272..f4cdc33e2038219c43fd84e09d6b2bda35a88ed4 100644 (file)
@@ -701,7 +701,10 @@ class VB5xExporter extends AbstractExporter
      */
     public function exportBoards($offset, $limit)
     {
-        $sql = "SELECT      node.*, channel.guid, channel.options AS channelOptions
+        $sql = "SELECT      node.*,
+                            channel.guid,
+                            channel.options AS channelOptions,
+                            channel.category AS isCategory
                 FROM        " . $this->databasePrefix . "node node
                 INNER JOIN  (
                                 SELECT  contenttypeid
@@ -745,7 +748,7 @@ class VB5xExporter extends AbstractExporter
         }
 
         foreach ($this->boardCache[$parentID] as $board) {
-            if ($board['channelOptions'] & self::CHANNELOPTIONS_CANCONTAINTHREADS) {
+            if (!$board['isCategory'] || ($board['channelOptions'] & self::CHANNELOPTIONS_CANCONTAINTHREADS)) {
                 $boardType = Board::TYPE_BOARD;
             } else {
                 $boardType = Board::TYPE_CATEGORY;