In https://www.drupal.org/project/jsonapi_extras/issues/3048341 the context was not passed correctly in ResourceIdentifierNormalizer.
But a similar issue also occurs within FieldItemNormalizer.
Enhancers on field level do not know anything about the context right now. Which could be easily resolved by passing the available context to undoTransform.
Another improvement on that would also be to add the $object (FieldItem) to the context to inform the enhancer through the context which fielditem is being enhanced.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | jsonapi_extras-pass_context_fielditemnormalizer-3062259-5.patch | 1.82 KB | jefuri |
Comments
Comment #2
jefuri commentedComment #3
jefuri commentedComment #4
jefuri commentedI noticed that entity references do not pass the field item object yet, this might be "important" information a developer would want in their enhancer.
Comment #5
jefuri commentedFor the resource identifier normalizer, there is no "field item" passed. Only the resource identifier for the entity reference. So I renamed it from field_item_object to field_item_resource_identifier.
Comment #6
e0ipsoComment #7
e0ipso