Skip to content

Commit

Permalink
tq: fix hidden query
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Mar 30, 2024
1 parent 4990099 commit d04eff2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Db/TimelineQueryDays.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ public function getDay(

// Add hidden field
if ($hidden) {
$query->addSelect('cte_f.hidden');
// we join with filecache anyway in this case, so just use the parent there
// this means this will work directly in trigger compatibility mode
$hSq = $this->connection->getQueryBuilder();
$hSq->select($hSq->expr()->literal(1))
->from('cte_folders', 'cte_f')
->andWhere($hSq->expr()->eq('cte_f.fileid', 'f.parent'))
->andWhere($hSq->expr()->eq('cte_f.hidden', $hSq->expr()->literal(1)));
$query->addSelect($query->createFunction("({$hSq->getSql()}) as hidden"));
}

// JOIN with mimetypes to get the mimetype
Expand Down

0 comments on commit d04eff2

Please sign in to comment.