EntityReferenceFieldNormalizer.php's Denormalizer mechanism is working fine for normal entity reference fields.
However, for entity like paragraph items which are having "entity_reference_revision" field type, it needs to save "target_revision_id" field as well.

Currently normalize() method is giving "target_revision_id" in "meta" array for that particular entity.
So during denormalize() we can map those attributes again.

Adding patch that provides solution with the help of @dawehner
Need to work on test cases which are related to paragraphs integration.

CommentFileSizeAuthor
#3 denormalizer_issue-2908439-3.patch1.03 KBmohit_aghera

Comments

mohit_aghera created an issue. See original summary.

mohit_aghera’s picture

Title: Denormalizer issue EntityReferenceFieldNormalizer.php when migrating paragraph content » Denormalizer issue EntityReferenceFieldNormalizer.php when importing paragraph content
mohit_aghera’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB
e0ipso’s picture

Thanks @mohit_aghera! I'll be merging this. Do you suppose you can provide a test for this for an extra commit credit? :-P

  • e0ipso committed e866cbe on 8.x-1.x authored by mohit_aghera
    fix(Serialization): Denormalize information in meta section (#2908439 by...
e0ipso’s picture

Status: Needs review » Fixed
mohit_aghera’s picture

@e0ipso yes, i'll work on test cases, added discussion on slack channel of contenta cms

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.