Skip to content

Commit

Permalink
We can't assume that the taxonomy is held in data now
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Nov 13, 2024
1 parent 8ce0c04 commit 7d71138
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Taxonomies/TermQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private function applyCollectionAndTaxonomyWheres()
$query->select(DB::raw(1))
->from($entriesTable)
->whereIn('collection', $this->collections)
->whereJsonContains("data->{$taxonomy}", $value);
->whereJsonContains(Entry::query()->column($taxonomy->handle()), $value);
})
->pluck('slug');
}
Expand All @@ -256,7 +256,7 @@ private function applyCollectionAndTaxonomyWheres()
->map(function ($term) use ($taxonomy) {
return Entry::query()
->whereIn('collection', $this->collections)
->whereJsonContains('data->'.$taxonomy, [$term->slug])
->whereJsonContains($taxonomy->handle(), [$term->slug])
->count() > 0 ? $term->slug : null;
})
->filter()
Expand Down

0 comments on commit 7d71138

Please sign in to comment.