Skip to content

Commit f10158b

Browse files
authored
[4.x] Pluck collectionHandle not collection (#491)
* Pluck collectionHandle not collection * Fixes * 🍺
1 parent 9159c41 commit f10158b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Entries/EntryQueryBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function ensureCollectionsAreQueriedForStatusQuery(): void
145145
// If no IDs were queried, fall back to all collections.
146146
$ids->isEmpty()
147147
? $this->whereIn('collection', Collection::handles())
148-
: $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->unique()->values());
148+
: $this->whereIn('collection', app(static::class)->whereIn('id', $ids)->pluck('collection')->map(fn ($collection) => $collection?->handle)->filter()->unique()->values());
149149
}
150150

151151
private function getCollectionsForStatusQuery(): \Illuminate\Support\Collection
@@ -221,7 +221,7 @@ protected function getJsonCasts(): IlluminateCollection
221221
|| ! isset($collectionWhere['value'])
222222
|| ! ($collection = Collection::find($collectionWhere['value']))
223223
) {
224-
return [];
224+
return collect([]);
225225
}
226226

227227
return $collection->entryBlueprints()

0 commit comments

Comments
 (0)