diff --git a/packages/plugin/src/controllers/export/QuickExportController.php b/packages/plugin/src/controllers/export/QuickExportController.php index bc90b08be..df0579816 100644 --- a/packages/plugin/src/controllers/export/QuickExportController.php +++ b/packages/plugin/src/controllers/export/QuickExportController.php @@ -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