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

Update from WP6.0 to 6.1 breaks some blocks #45153

Closed
t-hamano opened this issue Oct 20, 2022 · 14 comments
Closed

Update from WP6.0 to 6.1 breaks some blocks #45153

t-hamano opened this issue Oct 20, 2022 · 14 comments
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Oct 20, 2022

Description

I found that some blocks were broken when I updated from 6.0 to 6.1-RC2.

These blocks have a figcaption element or button-like element, and it appears that the block validation is failing. I have at least the following blocks broken by the update:

  • core/embed
  • core/gallery
  • core/video
  • core/file

The browser console error indicates that the newly added classes(.wp-element-button, .wp-element-caption) don't match.
I suspect it is a backward compatibility issue.

Step-by-step reproduction instructions

  • Clean install WordPress 6.0.X in your local environment.
  • Insert the blocks raised above, enter the caption text and save.
Example HTML
<!-- wp:audio -->
<figure class="wp-block-audio"><audio controls src="https://download.samplelib.com/mp3/sample-3s.mp3"></audio><figcaption>Audi Block Caption Text</figcaption></figure>
<!-- /wp:audio -->

<!-- wp:embed {"url":"https://twitter.com/Twitter/status/1580661436132757506?s=20\u0026t=-T9FiPsukIHF9XJChmG6wA","type":"rich","providerNameSlug":"twitter","responsive":true} -->
<figure class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter"><div class="wp-block-embed__wrapper">
https://twitter.com/Twitter/status/1580661436132757506?s=20&amp;t=-T9FiPsukIHF9XJChmG6wA
</div><figcaption>Embed Block Caption Text</figcaption></figure>
<!-- /wp:embed -->

<!-- wp:gallery {"linkTo":"none"} -->
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://live.staticflickr.com/4572/38004374914_6b686d708e_b.jpg" alt=""/><figcaption>Caption Text</figcaption></figure>
<!-- /wp:image -->

<!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://live.staticflickr.com/4572/38004374914_6b686d708e_b.jpg" alt=""/><figcaption>Caption Text</figcaption></figure>
<!-- /wp:image --><figcaption class="blocks-gallery-caption">Gallery Block Caption Text</figcaption></figure>
<!-- /wp:gallery -->

<!-- wp:table -->
<figure class="wp-block-table"><table><tbody><tr><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td></tr></tbody></table><figcaption>Table Block Caption Text</figcaption></figure>
<!-- /wp:table -->

<!-- wp:video -->
<figure class="wp-block-video"><video controls src="https://download.samplelib.com/mp4/sample-5s.mp4"></video><figcaption>Vide Block Caption Text</figcaption></figure>
<!-- /wp:video -->

<!-- wp:file {"id":7,"href":"http://wp61.wp/wp-content/uploads/2022/10/test1.jpg"} -->
<div class="wp-block-file"><a id="wp-block-file--media-8b25e306-3fa0-412b-bb3c-b3ef358e46d4" href="http://wp61.wp/wp-content/uploads/2022/10/test1.jpg">test1</a><a href="http://wp61.wp/wp-content/uploads/2022/10/test1.jpg" class="wp-block-file__button" download aria-describedby="wp-block-file--media-8b25e306-3fa0-412b-bb3c-b3ef358e46d4">Download</a></div>
<!-- /wp:file -->
  • Update to WordPress 6.1-RC2 with Beta Tester plugin, etc.
  • Confirm that the block is broken when you open the previous post in the editor.

Screenshots, screen recording, code snippet

Screenshots in WordPress 6.0.3

6 0 3

Screenshots in WordPress 6.1-RC2

6 1 0-RC2

Browser console error sample

error

Environment info

  • OS: Windows 11
  • Clean setup in Local
  • Theme: Twenty Twenty Two
  • Update from 6.0.3 to 6.1 via Beta Tester plugin

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Priority] High Used to indicate top priority items that need quick attention labels Oct 20, 2022
@youknowriad youknowriad moved this from Triage to Todo in WordPress 6.1 Editor Tasks Oct 20, 2022
@t-hamano
Copy link
Contributor Author

t-hamano commented Oct 20, 2022

I have listed the blocks where __experimentalGetElementClassName is used in the save function. Some books are probably unbreakable thanks to existing deprecation.
I think we need to examine the possibility of breakage and and add deprecations for them.

Block Element Update to 6.1 breaks? Needs to fix? Merged
audio caption Probabl not broken No
button button Probably not broken ⚠️Needs Testing Should be fixed separately: #45179
embed caption Yes #45166
file button Yes #45159
gallery caption Yes #45173
image caption Probably not broken No
table caption Yes #45161
video caption Yes #45169

@t-hamano
Copy link
Contributor Author

I have confirmed that this problem is reproduced in table blocks with color and caption. It doesn't reproduce in tables with only captions.
Also, although it may not be related to this issue, the table with palette background color loses background color.

d85f204ad848b57df1f085a7c7e6e8c7.mp4

@t-hamano
Copy link
Contributor Author

t-hamano commented Oct 20, 2022

As for the button and image, I have tried different variations and the blocks seems to be unbreakable.

@ockham
Copy link
Contributor

ockham commented Oct 20, 2022

FWIW, someone just filed a Core ticket that sounds a bit like this issue. Could y'all have a look and decide if it's a duplicate or if some other blocks might be affected after all? 🙌

@noisysocks
Copy link
Member

Another report of this here: https://wordpress.org/support/topic/getting-alot-of-console-errors-on-fresh-wordpress-install/

It looks like validation warnings for button are very common (1, 2, 3). Are we certain that the button block is not missing a deprecation?

@glendaviesnz
Copy link
Contributor

@noisysocks those button ones look like there is new block content being loaded by an older version of Gutenberg, eg. the post content has the wp-element-button added here, but the save method isn't adding this, but I need to do some more testing to confirm this.

@t-hamano
Copy link
Contributor Author

It looks like validation warnings for button are very common (1, #45179, 3). Are we certain that the button block is not missing a deprecation?

I think this is just the opposite case of what this issue is about. When patterns created in WP6.1 (i.e. with classes such as wp-element-XXX) are loaded in WP6.0, a console error occurs or the block is broken. In other words, the post-body expects to have a wp-element-xxx class, but the save function in WP6.0 does not expect it, so the block is broken.

It is not limited to button blocks, as seen in the console error this video shows. At the same time, you will also see the spacing preset markup mismatch error.

c7e332367f2751f32ce7c5d4da3f418d.mp4

@t-hamano t-hamano moved this from Todo to In Progress in WordPress 6.1 Editor Tasks Oct 21, 2022
@glendaviesnz
Copy link
Contributor

The trouble with the invalid buttons I think is unrelated to this issue so I think we should deal with it separately over on this issue.

@ockham
Copy link
Contributor

ockham commented Oct 25, 2022

Since the fixes for Embed, File, Gallery, Table, and Video have all been merged (and backported to 6.1), and the Buttons issue seems unrelated, I'll close this PR.

Feel free to re-open -- or open a new PR -- if something is still broken!

@ockham ockham closed this as completed Oct 25, 2022
Repository owner moved this from In Progress to Done in WordPress 6.1 Editor Tasks Oct 25, 2022
@lddd
Copy link

lddd commented Nov 3, 2022

Can't update to the German version of 6.1

Herunterladen der Aktualisierung von https://downloads.wordpress.org/release/de_DE/wordpress-6.1.zip…

Download fehlgeschlagen.: Not Found

Installation fehlgeschlagen.

@melvinisken
Copy link

It seems not to be solved. Today I run all updates and now my galleries look like in your screenshots. Here is the view in the editor and the page. I added my site info as well.
grafik
grafik
siteinfo.txt

@ozolinaa
Copy link

ozolinaa commented Nov 4, 2022

Also experiencing issues, should be re-opened

@t-hamano
Copy link
Contributor Author

t-hamano commented Nov 4, 2022

Thanks for the report.
This issue is about blocks "breaking" due to a lack of backward compatibility support.

@lddd

If you access the following URL directly, the data appears to be downloaded correctly.
https://downloads.wordpress.org/release/de_DE/wordpress-6.1.zip

If the problem you report is not resolved, WordPress Trac would be the appropriate place to report it.

@melvinisken

A similar problem was reported in #45423.
If it is not similar to this issue, it's a good idea tosubmit a new issue.

@melvinisken
Copy link

@melvinisken

A similar problem was reported in #45423. If it is not similar to this issue, it's a good idea tosubmit a new issue.

Thanks, I will check. Meanwhile I downgraded to 6.0.3 and everything is running smoothly again :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

No branches or pull requests

7 participants