diff --git a/src/Entries/EntryQueryBuilder.php b/src/Entries/EntryQueryBuilder.php index 2bec7f03..fcf9e016 100644 --- a/src/Entries/EntryQueryBuilder.php +++ b/src/Entries/EntryQueryBuilder.php @@ -145,7 +145,7 @@ private function ensureCollectionsAreQueriedForStatusQuery(): void // If no IDs were queried, fall back to all collections. $ids->isEmpty() ? $this->whereIn('collection', Collection::handles()) - : $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values()); + : $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->map(fn ($collection) => $collection?->handle)->filter()->unique()->values()); } private function getCollectionsForStatusQuery(): \Illuminate\Support\Collection @@ -221,7 +221,7 @@ protected function getJsonCasts(): IlluminateCollection || ! isset($collectionWhere['value']) || ! ($collection = Collection::find($collectionWhere['value'])) ) { - return []; + return collect([]); } return $collection->entryBlueprints()