Skip to content

Commit d2b9849

Browse files
committed
fix(TreeMapper#getSoftDeletedRootItems): Do not return folders twice
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 1cc599a commit d2b9849

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Db/TreeMapper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,10 @@ public function getSoftDeletedRootItems(string $userId, string $type): array {
10371037
$qb = $this->selectFromType($type);
10381038
$qb
10391039
->innerJoin('i', 'bookmarks_tree', 't', $qb->expr()->eq('i.id', 't.id'))
1040-
->leftJoin('t', 'bookmarks_tree', 't2', $qb->expr()->eq('t.parent_folder', 't2.id'))
1040+
->leftJoin('t', 'bookmarks_tree', 't2', $qb->expr()->andX(
1041+
$qb->expr()->eq('t.parent_folder', 't2.id'),
1042+
$qb->expr()->eq('t2.type', $qb->createPositionalParameter(TreeMapper::TYPE_FOLDER, IQueryBuilder::PARAM_STR)),
1043+
))
10411044
->leftJoin('t', 'bookmarks_root_folders', 'r', $qb->expr()->eq('t.parent_folder', 'r.folder_id'))
10421045
->where($qb->expr()->isNotNull('t.soft_deleted_at'))
10431046
->andWhere($qb->expr()->eq('t.type', $qb->createPositionalParameter($type, IQueryBuilder::PARAM_STR)))

0 commit comments

Comments
 (0)