diff --git a/src/Entries/EntryQueryBuilder.php b/src/Entries/EntryQueryBuilder.php index 0a37b5c3..0eac75dc 100644 --- a/src/Entries/EntryQueryBuilder.php +++ b/src/Entries/EntryQueryBuilder.php @@ -198,11 +198,9 @@ private function ensureCollectionsAreQueriedForStatusQuery(): void $ids = $wheres->where('column', 'id')->flatMap(fn ($where) => $where['values'] ?? [$where['value']]); // If no IDs were queried, fall back to all collections. - if ($ids->isEmpty()) { - return $this->whereIn('collection', Collection::handles()); - } - - $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values()); + $ids->isEmpty() + ? $this->whereIn('collection', Collection::handles()) + : $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values()); } private function getCollectionsForStatusQuery(): \Illuminate\Support\Collection