Skip to content

Commit

Permalink
Hotfix: disable eager loading of previewItems
Browse files Browse the repository at this point in the history
because it does not seem to work when there's a limit() on relationship
  • Loading branch information
eronisko committed Mar 9, 2024
1 parent a5ec6e1 commit c2ab064
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function getIndexData()

$authorities = Authority::query()
->whereIn('id', $authorityIds)
->with(['previewItems', 'translations'])
->with(['translations'])
->orderByRaw('FIELD(id, ' . $authorityIds->join(',') . ')')
->get()
->map(function (Authority $authority, $index) use ($itemCounts) {
Expand Down

0 comments on commit c2ab064

Please sign in to comment.