Merge branch 'PreorderLogistics/add-multiple-campaigns' into 'master'

preorderlogistcs fix fcp filter and fix multiple campaigns

See merge request fronk/thetool!1850
This commit is contained in:
Luca Haid
2025-10-20 10:59:10 +00:00

View File

@@ -186,8 +186,15 @@ class PreorderlogisticsController extends mfBaseController {
if (empty($filter['preordercampaign_id'])) {
$filter['preordercampaign_id'] = $my_campaign_ids;
} elseif (!in_array($filter['preordercampaign_id'], $my_campaign_ids)) {
return [];
} else {
// Ensure the filtered campaign is one the user has access to are arrays and if not allowed dont push it to the filter
$preordercampaign_ids = is_array($filter['preordercampaign_id']) ? $filter['preordercampaign_id'] : [$filter['preordercampaign_id']];
$new_allowed_ids = array_intersect($preordercampaign_ids, $my_campaign_ids);
if (empty($new_allowed_ids)) {
self::returnJson(['rows' => [], 'pagination' => ['total_rows' => 0]]);
return;
}
}
// Return objects for methods that expect them