Problem/Motivation

Some normalizers, e.g. those provided by extras, need this context.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bradjones1 created an issue. See original summary.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Can you point to a more concrete example?

Other than that minor gripe: I see no harm in doing this, especially for a module in the early stages like this one.

bradjones1’s picture

The example would be an extras field enhancer that either includes metadata that varies on the bundle or entityid, or needs those contexts to compute the value, or do other transformations.

wim leers’s picture

Makes sense — and by passing it in as context, the entity does not need to be loaded again 👍

bradjones1’s picture

Yeah I mean ideally we could just get the specific field item list being normalized, however it's not (no longer?) in context from the caller.

m.stenta’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

We have automated tests now (#3257911: Add basic test coverage) so it would be good to include a test to demonstrate this issue and prevent regressions.