Problem/Motivation
Logic for fieldable entities currently lives in EntityNormalizer, this should live in a FieldableEntityNormalizer class. So we can make the assumption that we are dealing with entities implementing FieldableEntityInterface. We currently can't really make this change as people could be relying on the field specific code we have in the EntityNormalizer.
This is not idea implementation wise, as for example, it will get called for ConfigEntities too, which means we have to check for this during denormalization.
Proposed resolution
Add a FieldableEntityNormalizer class, so our hierarchy is EntityNormalizer > FieldableEntityNormalizer > ContentEntityNormalizer. Code currently in FieldableEntityNormalizerTrait can move into the new class.
Remaining tasks
Add class and tests.
User interface changes
N/A
API changes
Addition of FieldableEntityNormalizer
Data model changes
N/A
Comments
Comment #2
damiankloip commentedComment #3
wim leers#2827218: Denormalization on field items is never called: add FieldNormalizer + FieldItemNormalizer with denormalize() methods landed, this is now unblocked!
Comment #4
wim leersOops, this is D9 material. Postponing again.
Comment #5
wim leersComment #6
xjmThis should be attempted as the addition of a new parallel API in D8, since D9 is intended to only be the removal of deprecated code:
http://buytaert.net/making-drupal-upgrades-easy-forever
Comment #7
damiankloip commentedHmm, if that's the case, I vote we just go with the break, like we have done in a few other similar serializer/rest issues.
Comment #8
wim leersShouldn't we first ship a release that does a
trigger_error('blah', E_USER_DEPRECATED)? Although I guess in this case we can't, because we can't ship both the old and the new implementations side-by-side.Comment #15
longwaveSpotted this todo while working on a REST implementation, I don't think this should be postponed - we will just have to figure out how to deal with BC if we are still to make this change.
Comment #21
mondrake