Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Validation: Further improve deprecations warnings for nested blocks #17992

Open
gziolo opened this issue Oct 17, 2019 · 3 comments
Open
Labels
[Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@gziolo
Copy link
Member

gziolo commented Oct 17, 2019

Follow-up for #16862 where landed changes that prevent showing errors and warnings when blocks get successfully updated from the deprecated version. Ther is still this edge case which needs to be resolved for nested blocks as described by @mcsf in #16862 (review):

The flow in the log can be a bit awkward depending on what is valid and invalid. Steps to repro:

  1. Change the demo content by adding a bogus data attribute to the first DIV, like so:
diff --git a/post-content.php b/post-content.php
index 032c4ad10..7f3621ada 100644
--- a/post-content.php
+++ b/post-content.php
@@ -7,7 +7,7 @@
 
 ?>
 <!-- wp:cover {"url":"https://cldup.com/Fz-ASbo2s3.jpg","className":"alignwide"} -->
-<div class="wp-block-cover has-background-dim alignwide" style="background-image:url(https://cldup.com/Fz-ASbo2s3.jpg)"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
+<div class="wp-block-cover has-background-dim alignwide" data-foo="bar" style="background-image:url(https://cldup.com/Fz-ASbo2s3.jpg)"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
 <p style="text-align:center" class="has-large-font-size"><?php _e( 'Of Mountains &amp; Printing Presses', 'gutenberg' ); ?></p>
 <!-- /wp:paragraph --></div></div>
 <!-- /wp:cover -->
  1. This will break the opening Cover block of the demo.

  2. Open the demo post. Notice how the first line logged reads Block successfully updated for core/paragraph, which refers to the P tag inside the broken Cover block. The following lines are errors logged for the invalid Cover block as a whole.

  3. The first line, about core/paragraph, should probably not be there, since in the end we didn't get a new Paragraph block in the block list, we only get an invalid Cover block.

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation Needs Dev Ready for, and needs developer efforts labels Oct 17, 2019
@paaljoachim
Copy link
Contributor

Hi Greg @gziolo
Is this issue still valid?

@gziolo
Copy link
Member Author

gziolo commented Jan 18, 2021

I don't see any referenced PRs, so it still has to be implemented. It's going to become a more evident issue when we see more FSE themes since they use nested blocks extensively.

@paaljoachim
Copy link
Contributor

I just added the Full Site Editing label to it as this as you say impacts FSE themes.

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants