Skip to content

Commit 8ee3f3d

Browse files
committed
Fix bug in tag page service: do not require tag type to find tags
1 parent a820e09 commit 8ee3f3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Services/TagPageService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function getUnionQueryResults(Tag $tag, int $perPage): LengthAwarePagina
5555

5656
foreach ($enabledModels as $modelClass) {
5757
/** @var class-string $modelClass */
58-
$query = $modelClass::withAnyTags([$tag->name])
58+
$query = $modelClass::withAnyTagsOfAnyType([$tag->name])
5959
->select([
6060
'id',
6161
'publishing_begins_at',
@@ -100,7 +100,7 @@ private function hydrateModels(Collection $groupedIds, Tag $tag): Collection
100100

101101
// Load actual models with eager loading
102102
/** @var class-string $modelClass */
103-
$modelInstances = $modelClass::withAnyTagsOfAnyType([$tag->name])
103+
$modelInstances = $modelClass::query()
104104
->whereIn('id', $ids)
105105
->when(method_exists($modelClass, 'scopePublished'), function ($query) {
106106
return $query->published();

0 commit comments

Comments
 (0)