- πΊπΈUnited States ebeyrent
I have a custom entity with a DER field that allows either users or nodes to be referenced. Here's an example jsonapi representation of that field:
"subject_entity": { "data": { "type": "user--user", "id": "02873322-eb7c-4984-bf32-7cb7e8ec1b68", "meta": { "target_type": "user", "drupal_internal__target_id": 1237 } }, "links": { "self": { "href": "https://my-site.com/jsonapi/my_entity/my_entity/cfbb318c-dc03-4061-b0a2-b123ac904a5c/relationships/subject_entity?resourceVersion=id%3A387" } } }
Because this field can reference either users or nodes, I want to be able to filter by the target_type:
jsonapi/my_entity/my_entity?filter[subject_entity.meta.drupal_internal__target_id]=1237&filter[subject_entity.meta.target_type]=user
This fails:
"errors": [ { "title": "Bad Request", "status": "400", "detail": "Invalid nested filtering. The field `target_type`, given in the path `subject_entity.meta.target_type`, does not exist.",
Worse, if I try to include that object in my query like this:
/jsonapi/my_entity/my_entity?include=subject_entity
I get this error:
"errors": [ { "title": "Bad Request", "status": "400", "detail": "`subject_entity` is not a valid relationship field name. Possible values: revision_user, subject_entity, related_entity.",
- πΊπΈUnited States ebeyrent
I've applied the patch, and it fixes the issue of not being able to filter by target_type. It does not fix the inability to include the referenced data.