eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Multiple taxonomy terms returned when same term exists for multiple taxonomies

Open andrasvati opened this issue 3 years ago • 3 comments

When multiple terms with same slugs exists in different taxonomies, e.g. Taxonomy: Tags, Term: Pop Taxonomy: Genres, Term: Pop then for a collection entry where only one taxonomy is attached (e.g. Genres), both Terms (tags/pop and genres/pop) are returned on control panel listing (and who knows where else) It's an issue in Taxonomies/TermQueryBuilder.php where and whereIn functions, because the taxonomy-wheres aren't applied in this case.

andrasvati avatar Oct 18 '22 12:10 andrasvati

Taxonomy wheres are applied during get() and paginate(), they dont need to be added to where and whereIn. I've run a quick test and I'm not able to replicate this locally - are you able to share your blueprints so I can try and reproduce it?

ryanmitchell avatar Oct 18 '22 12:10 ryanmitchell

Here are the blueprints for the collection and taxonomies. taxonomy_issue.zip Try to create a taxonomy term with same slug in both taxonomies, and attach one of them to the collection entry. You should see both terms in the collection listing taxonom-issue

andrasvati avatar Oct 19 '22 08:10 andrasvati

Yeah I can see this, though Im not convinced its a specific to eloquent bug as the taxonomy limitation is not being applied at the field level (that I can see).

If you mount the genres taxonomy on the collection (in the collection edit form) it then limits it to genres. So thats a work around to get past your issue.

ryanmitchell avatar Oct 19 '22 08:10 ryanmitchell