Problem/Motivation

Quoting Wim Leers at #2543726-247: Make $term->parent behave like any other entity reference field, to fix REST and Migrate support and de-customize its Views integration:

I followed the steps in #246 (albeit without using drush). I reproduced it.

The root cause is not Commerce, nor this patch. It's the entity_reference_revisions module's \Drupal\entity_reference_revisions\EntityReferenceRevisionsServiceProvider. That will need to be updated.
(And if that code used the service decorator pattern, it wouldn't even need to be updated. Look at the html_response.attachments_processor.big_pipe service for an example of that.)

That was wrong, see #3, but using the parent: … pattern is possible. It still achieves the same: removing the need to keep this subclass' service's arguments in sync with the parent's.

Proposed resolution

Use parent: … pattern, then you won't have to update this again in the future.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 2931496-5.patch1.58 KBwim leers

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Title: Refactor serializer.normalizer.entity_reference_revision_item service to use service decorator pattern » Refactor serializer.normalizer.entity_reference_revision_item service to use service decorator pattern and don't make it HAL-only
Priority: Major » Critical

Oh and I noticed that it's a HAL-only normalizer. What about the "default" normalization provided by the serialization module, for the json and xml formats? You simply don't support those!

berdir’s picture

Title: Refactor serializer.normalizer.entity_reference_revision_item service to use service decorator pattern and don't make it HAL-only » Add serializer for json/xml
Priority: Critical » Major

As discussed in that issue, decorator doesn't work and anyone is welcome to provide patches to support the other formats, it simply wasn't something we needed so far.

idebr’s picture

wim leers’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.58 KB

(Going through ancient browser tabs. Sorry for the very slow reply!)

You're right, using decorates: … is not possible, but using parent: … is.

miro_dietiker’s picture