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

Buttons created with Gutenberg enabled creates block validation errors when Gutenberg is deactivated #41996

Closed
carolinan opened this issue Jun 28, 2022 · 4 comments
Labels
[Block] Buttons Affects the Buttons Block [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation

Comments

@carolinan
Copy link
Contributor

Description

Originally reported by @kafleg:
Buttons created with Gutenberg active, causes a block validation error in the editor because the miss match of CSS classes when Gutenberg is deactivated:

Content generated by `save` function:

<div class="wp-block-button"><a class="wp-block-button__link">fdsfsdf</a></div>

Content retrieved from post body:

<div class="wp-block-button"><a class="wp-block-button__link wp-element-button">fdsfsdf</a></div>

Step-by-step reproduction instructions

  1. Activate Gutenberg 13.4 or newer, or Gutenberg trunk.
  2. In the block editor, create a post or page and add some button blocks.
  3. Deactivate Gutenberg.
  4. View the post or page you just created and check if there are block validation errors for the buttons.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@carolinan carolinan added the [Block] Buttons Affects the Buttons Block label Jun 28, 2022
@Mamaduka
Copy link
Member

Probably related to #40260. The Button block will need a deprecation.

cc @scruffian.

@talldan
Copy link
Contributor

talldan commented Jun 28, 2022

I don't think a block deprecation would be possible though, as it would need to be added to an already released version of WordPress core.

TBH, it's possible to get this issue with any block whenever content is created in a newer block editor and then loaded in an older one.

@t-hamano
Copy link
Contributor

I believe this issue is also related to #41140.
For blocks with __experimentalGetElementClassName, disabling Gutenberg after saving the content will break the block.

This is the list of blocks to which __experimentalGetElementClassName is applied:

  • core/audio
  • core/button
  • core/embed
  • core/file
  • core/gallery
  • core/image
  • core/table
  • core/video

@draganescu
Copy link
Contributor

It's like @talldan said unlikely to have a solution via a deprecation and also hard to solve: content created with newer editors can become invalid in older editors for editing. Gutenberg guarantees the content itself is independent of Gutenberg and via it's universal format and invisible markup does not depend on WordPress to be consumed. But editing blocks in older versions will be problematic.

I think a cool thing would be if we can detect that the user needs a newer editor and inform them.

@skorasaurus skorasaurus added the [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation label Jun 28, 2022
@carolinan carolinan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation
Projects
None yet
Development

No branches or pull requests

6 participants