Problem/Motivation

In #2827218: Denormalization on field items is never called: add FieldNormalizer + FieldItemNormalizer with denormalize() methods entities are denormalized using field data, however only if the entity has a bundle key. Entities may implement FieldableEntityInterface without implementing bundles.

Proposed resolution

In EntityNormalizer::denormalize(), test initially on implementation of the required interface, then nest the existing bundle key-related logic inside a condition.

Remaining tasks

None?

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
normalize-bundles.patch2.42 KBbradjones1

Comments

bradjones1 created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, normalize-bundles.patch, failed testing.

damiankloip’s picture

Yes, we figured this too :) Good catch though! User entities are a perfect case for this in core. This was not something introduced in #2827218: Denormalization on field items is never called: add FieldNormalizer + FieldItemNormalizer with denormalize() methods, the check was already there. This will already be fixed as a part of #2768651: Let TimestampItem (de)normalize to/from RFC3339 timestamps, not UNIX timestamps, for better DX - which has more comprehensive test coverage and fix.

wim leers’s picture