Fix the handling of the nullable group description
authorAlexander Ebert <ebert@woltlab.com>
Sat, 16 Sep 2023 12:44:36 +0000 (14:44 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 16 Sep 2023 12:44:36 +0000 (14:44 +0200)
See https://www.woltlab.com/community/thread/301633-datenimport-von-5-5-auf-6-0/

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

index 5d81bae51f50fd9cd739d3dce4e956035bab70c6..81101f281e78b7cfaa54b7e9f76907a1dc033701 100644 (file)
@@ -518,9 +518,11 @@ final class WBB4xExporter extends AbstractExporter
         $groups = [];
         $i18nValues = [];
         while ($row = $statement->fetchArray()) {
+            $groupDescription = $row['groupDescription'] ?? '';
+
             $groups[$row['groupID']] = [
                 'groupName' => $row['groupName'],
-                'groupDescription' => $row['groupDescription'],
+                'groupDescription' => $groupDescription,
                 'groupType' => $row['groupType'],
                 'priority' => $row['priority'],
                 'userOnlineMarking' => !empty($row['userOnlineMarking']) ? $row['userOnlineMarking'] : '',
@@ -530,8 +532,8 @@ final class WBB4xExporter extends AbstractExporter
             if (\str_starts_with($row['groupName'], 'wcf.acp.group.group')) {
                 $i18nValues[] = $row['groupName'];
             }
-            if (\str_starts_with($row['groupDescription'], 'wcf.acp.group.groupDescription')) {
-                $i18nValues[] = $row['groupDescription'];
+            if (\str_starts_with($groupDescription, 'wcf.acp.group.groupDescription')) {
+                $i18nValues[] = $groupDescription;
             }
         }