Closed (fixed)
Project:
Gutenberg
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2020 at 13:39 UTC
Updated:
19 Nov 2021 at 21:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mnlund commentedComment #3
mnlund commentedComment #4
glardupI have the same problem.
I have a schema with a title (simple-text), subtitle (simple-text), intro (section) and body (section):
[
["drupal/simple-text", {"placeholder": "Title","tag":"h1", "mappingFields": [{"field": "title"}]}],
["drupal/simple-text", { "placeholder":"Subtitle", "tag":"h2", "mappingFields": [{"field": "field_subtitle"}] }],
["drupal/section", { "placeholder":"Intro", "mappingFields": [{"field": "field_intro"}] }],
["drupal/section", {"placeholder":"Page content" }]
]
I applied your patch but now I have 2 new problems:
- The subtitle is merged with the body field (before the wp-block-drupal-section)
- The intro looses it's paragraphs: they are merged into one
Comment #5
szeidlerThe patch does not apply anymore for the 8.x-2.x branch, since the BlockParser has been refactored drastically. From the first glance it seems to support recursive block mapping. Can someone test and confirm this?
Comment #6
kiss.jozsef commentedThere was no support for innerblocks , the BlockParser add the innerblocks correctly but when saving the data to the mapped field only the top level innerHTML is taken in account and that is empty ... maybe this isn't the best approach we might need to alter the BlockParser so the top level innerHTML contains all children innerHTML also but for now the attached patch fixes the issue
Comment #7
szeidlerComment #9
marcofernandes commentedComment #10
marcofernandes commented