Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In #2848878: Embed Paragraph Content in Normalized Parent Entities (REST), we will add support for inlining paragraphs completely into their host entity as part of serialization.
However, those nested paragraphs might have references, e.g. to files.
This makes the embeded parsing a method that can call itself recursively.
I just saw #2860958: Decompose Importer::importContent() method which does a lot more refactoring and will obviously conflict with this, but it doesn't actually do anything about this specific problem.
Comment | File | Size | Author |
---|---|---|---|
#2 | default-content-2876571-2.patch | 1.85 KB | Berdir |
|
Comments
Comment #2
BerdirHere's a first patch, untested.
Comment #3
BerdirIf you're wondering, nested _embedded does seem to be supported in the standard according to https://danmessenger.wordpress.com/2014/07/15/haljson-embedded-inside-em...
Comment #4
andypostImo better to get this in first and later iterate on refactoring
Comment #5
larowlanLooks good.
Should we add some sort of recursion detection? Is it possible that there might be a circular _embedded scenario?
Would be good to get a test in here too, happy to add paragraphs as a
test_dependency
Comment #6
BerdirThis is a plain array parsed from JSON. I'm pretty sure there is no real use case which could have a recursion?
Comment #7
BerdirThis is no longer required in 2.0.x, the normalization puts all dependencies into the root meta info.