fix(BookmarkMapper#_selectTags): Always return a string for tags column

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2024-01-03 16:52:09 +01:00
parent 29e6b0b98f
commit 9ae5a7b471
2 changed files with 2 additions and 6 deletions

View File

@ -812,7 +812,7 @@ class BookmarkMapper extends QBMapper {
if ($dbType === 'pgsql') {
$tagsCol = $qb->createFunction('array_to_string(array_agg(' . $qb->getColumnName('t.tag') . "), ',')");
} else {
$tagsCol = $qb->createFunction('GROUP_CONCAT(' . $qb->getColumnName('t.tag') . ')');
$tagsCol = $qb->createFunction('IFNULL(GROUP_CONCAT(' . $qb->getColumnName('t.tag') . '), "")');
}
return $tagsCol;
}

View File

@ -28,13 +28,9 @@ class BookmarkWithTagsAndParent extends Bookmark {
$array[$field] = $this->{$field} === '' ? [] : array_values(array_unique(explode(',', $this->{$field})));
continue;
}
if ($this->{$field} === null) {
$array[$field] = [];
continue;
}
}
if ($field === 'folders') {
if ($this->{$field} === '' || $this->{$field} === null) {
if ($this->{$field} === '') {
$array[$field] = [];
} else {
$array[$field] = array_values(array_unique(array_map(static function ($id) {