Skip to content

Commit da908d5

Browse files
committed
change default of
Signed-off-by: dartcafe <github@dartcafe.de>
1 parent 5f8a1d8 commit da908d5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/Db/PollMapper.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,14 @@ protected function joinUserRole(
247247
): void {
248248
$emptyString = $qb->expr()->literal('');
249249

250-
$qb->selectAlias($qb->createFunction('coalesce(MAX(' . $joinAlias . '.type), ' . $emptyString . ')'), 'user_role');
251-
$qb->selectAlias($qb->createFunction('coalesce(MAX(' . $joinAlias . '.token), ' . $emptyString . ')'), 'share_token');
252-
$qb->selectAlias('MAX(' . $joinAlias . '.locked)', 'is_current_user_locked');
250+
$qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.type, ' . $emptyString . ') AS user_role'))
251+
->addGroupBy($joinAlias . '.type');
252+
253+
$qb->selectAlias($joinAlias . '.locked', 'is_current_user_locked')
254+
->addGroupBy($joinAlias . '.locked');
255+
256+
$qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.token, ' . $emptyString . ') AS share_token'))
257+
->addGroupBy($joinAlias . '.token');
253258

254259
$qb->leftJoin(
255260
$fromAlias,

0 commit comments

Comments
 (0)