Problem/Motivation
The clone section contains a custom block with entity reference revision not working
Steps to reproduce
- Install the Section Library module.
- Create block type for example block-A.
- Create block type for example block-B.
- In block-B Add entity reference revision field to block-A.
- Make the field formatter an inline form complex
- Try adding block B with block-A items to the layout builder.
- Try to save the section from the section library.
- Try to import the template to another page.
Proposed resolution
- Patch to fix the issue on inline blocks with entity reference revision
Remaining tasks
- Patch fix
- Core review
- Test
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3327048-15.diff | 6.79 KB | kevinvb |
| #9 | 3327048-9.patch | 7.05 KB | deepak.cms |
| #6 | 3327048-6.patch | 7.06 KB | qusai taha |
| #2 | 3327048-2.patch | 7.16 KB | qusai taha |
Issue fork section_library-3327048
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
qusai taha commentedPatch to fix the issue on inline blocks with entity reference revision
Comment #3
rajab natshahComment #4
rajab natshahComment #6
qusai taha commentedFix the issue after saving the layout builder page
Comment #7
rajab natshahComment #8
deepak.cms commentedAbove line is giving an error when importing the section from library.
Comment #9
deepak.cms commentedComment #10
jastraat commentedI was unable to recreate this error with an entity reference revision field targeting content block and using the steps above in 1.2.2. Are there additional steps required to trigger the error or more details that could be provided?
Comment #11
weseze commentedI think I ran into a similar issue over here: https://www.drupal.org/project/section_library/issues/3275063
Also had a blok reference field and expected the block reference to duplicate. Instead the section in the library was referencing the same block as the original section and the imported section was also referencing the same block.
Not sure if the suggested patch is the correct way of doing things.
Leaving entity references intact vs. duplicating the references feels like it should be a choice, not fixed behaviour.
That is why I suggested to have hooks available so you can decide to alter the behaviour in a custom setup.
Comment #12
kevinvb commentedI still encountered this issue in a 1.2.2 version of the module.
You need to have a block type with a entity reference revision field to eg. a custom content entity or something else then pararagraphs.
If you then create a section with a block of this type in it and try to save it as a template the serialization of the block failes because it loses its revision_id.
Attached I provided an update patch because the one in this issue didn't apply anymore.