Closed (won't fix)
Project:
Default Content
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Aug 2018 at 13:06 UTC
Updated:
19 Jul 2020 at 12:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
larowlanWe only rely on core's serialization api here.
So it depends on what entity_reference_revisions does for normalizing/denormalizing its field type.
Can you see if they have an issue in their queue tracking improvements to that?
Comment #3
andypostI'm using `dcer` to export nodes with paragraphs for a long time & remember no issues for last year at least
Comment #4
apugacescu commentedFaced the same issue, using 8.4.7 core. Exported entities have id and revision_id/vid (depending on entity type) in json file but during import revisions are created sequentially so the relation between nodes and paragraphs are broken after import because revision id does not match.
This issue was not present in 8.3.
Comment #5
apugacescu commentedComment #6
apugacescu commentedAfter some investigation found out the following:
Entity's "newRevision" attribute "Boolean indicating whether a new revision should be created on save" defaults to TRUE (which is correct) but during deserialization process changes the value to FALSE. It is triggered by onChange event deep inside the stack here https://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/Entity/Cont.... This indeed should happen but not during deserialization process but during save process instead (which actually happens).
Now when "newRevision" attribute is FALSE the save process triggers setNewRevision method that removes existing value of the revision that was extracted from the exported content json which triggers the process of new revision generation (incremental value).
The problem that I see here is that the content is wrong state. It should have a revision id and newRevision should be TRUE in order to keep existing revision id from the exported file. Currently we are getting newRevision FALSE and a revision id that is removed and regenerated.
Attaching a patch that should fix this issue it might not be the most elegant solution but it worked in my case.
Comment #7
botanic_spark commentedI was facing same issue on Drupal 8.4.7.
After applying the patch, paragraphs are exported fine.
Comment #8
lpeabody commentedWorks for me. Thank you!
Comment #9
larowlanThanks, the patch makes sense - but can we get a test for this?
Comment #10
berdirI've recently created the 2.0.x branch, see the project page on all the improvements in the 2.0.x branch. Testing that and providing feedback would be very welcome. The 1.x branch isn't actively maintained and won't receive new features anymore, so I'm closing this and other issues as won't fix.
2.0.x does not export or import ID fields and ERR composite fields like paragraphs are automatically embedded into a single file.