Skip to content

Commit

Permalink
fix(CoreQueryBuilder): Use correct member entry for circle as initiator
Browse files Browse the repository at this point in the history
Before, the member entry that matched the `singleId` of the user and
`level = 9` was used as initiator, which in practice means the member
entry for the internal user circle of the user most of the time.

Instead, we want to use the member entry that matches `singleId` of
the user and `circleId` of the circle in question.

This fixes the wrong `level` being set for `initiator` when calling
`circleProbe()` with `DataProbe::INITIATOR`.

Fixes: #1757

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Nov 25, 2024
1 parent ae04efc commit e56f569
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Db/CoreQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,8 @@ public function completeProbeWithInitiator(
->leftJoin(
$alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator,
$expr->andX(
$expr->eq($aliasInitiator . '.circle_id', $helperAlias . '.' . $field),
$this->exprLimitInt('level', Member::LEVEL_OWNER, $aliasInitiator)
$expr->eq($aliasInitiator . '.circle_id', $alias . '.unique_id'),
$expr->eq($aliasInitiator . '.' . $field, $helperAlias . '.inheritance_first'),
)
);
//
Expand Down

0 comments on commit e56f569

Please sign in to comment.