-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Image block: Add check for lightbox values during image block migration #56057
Conversation
Size Change: +11 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEligible is used to force a deprecation to run but that doesn't mean that for a deprecation to run, it has to be true. Deprecations first run if the block is invalid. So this fix make sense to me.
I just cherry-picked this PR to the 6.4-next-point-release branch to get it included in the next release: f42a5ef |
What?
This PR adds a check for the
behaviors
andbehaviors.lightbox
attributes during image block migration to prevent the Gutenberg editor from breaking unexpectedlyWhy?
Addresses #56055
Editing image block attributes dynamically may cause block invalidation and the image's migration logic to run, bypassing the
isEligible()
method, and we need an extra check to ensure the editor doesn't break.How?
It adds a check in the image block's
deprecated.js
.Testing Instructions
functions.php
:Screenshots or screencast
Here's a screenshot of the error one receives without the check from this PR: