Skip to content

Commit

Permalink
fix(SFT-1664): checking current site ID when gathering export results
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavs-gutmanis committed Dec 18, 2024
1 parent 07d0a9d commit 5b6cf17
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/plugin/src/controllers/export/QuickExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,19 @@ public function actionIndex()
->andWhere(['s.[[isSpam]]' => $isSpam])
;

$siteId = \Craft::$app->getSites()->getCurrentSite()->id;
if ($isCraft5) {
$query->innerJoin('{{%elements_sites}} es', 'es.[[elementId]] = s.[[id]]');
$query->innerJoin(
'{{%elements_sites}} es',
'es.[[elementId]] = s.[[id]] AND es.[[siteId]] = :siteId',
['siteId' => $siteId]
);
} else {
$query->innerJoin('{{%content}} c', 'c.[[elementId]] = s.[[id]]');
$query->innerJoin(
'{{%content}} c',
'c.[[elementId]] = s.[[id]] AND c.[[siteId]] = :siteId',
['siteId' => $siteId]
);
}

// TODO: reimplement with payments
Expand Down

0 comments on commit 5b6cf17

Please sign in to comment.