mirror of https://github.com/nextcloud/bookmarks
fix(BookmarkMapper#_selectTags): Always return a string for tags column
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
parent
29e6b0b98f
commit
9ae5a7b471
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue