Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Use case:
example.com/taxonomy_term.json?bundle=product
is not possible, neither is filtering by vid.
Daring to raise prio as no workaround.
Comment | File | Size | Author |
---|---|---|---|
#2 | restws-2857490-2-Filter-by-bundle.patch | 1.67 KB | geek-merlin |
Comments
Comment #2
geek-merlinPatch flying in that works for me.
Comment #3
m.stentaFYI: it is actually possible to filter by vocabulary ID, but you need to use "?vocabulary=1" instead of "?vid=1".
So when I want to filter terms to a specific vocabulary's machine name, I will first make a request to /taxonomy_vocabulary.json to get a list of vocabularies, search for the machine name I want to get the vid, and then do a second request for terms filtered by that vid.
A general purpose bundle filter would allow this to be done with a single request. So I support this. :-)
Comment #4
m.stentaI tested this patch with two different entity types and it seems to work perfectly. The actual code change is dead simple, so I think we can mark this RTBC.