Skip to content

Commit 265ee3b

Browse files
committed
fix: use _organisation (magic-table prefix) in native aggregation WHERE
1 parent 91a8e5d commit 265ee3b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Service/Aggregation/AggregationRunner.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,10 @@ private function tryNativeAggregation(
560560
// native fast path bypasses MagicMapper entirely, so without this
561561
// filter any authed caller could compute aggregates over rows in
562562
// other tenants. Active org of `null` ⇒ no rows (fail-closed).
563+
// Column is `_organisation` — magic tables prefix metadata cols
564+
// with `_` (see MagicMapper::METADATA_PREFIX).
563565
$activeOrg = $this->organisationService->getActiveOrganisation();
564-
$whereParts[] = '"organisation" = ?';
566+
$whereParts[] = '"_organisation" = ?';
565567
$bindings[] = $activeOrg?->getUuid() ?? '__no_active_org__';
566568

567569
foreach ($filter as $f => $v) {

0 commit comments

Comments
 (0)