Image block: Add check for lightbox values during image block migration#56057
Merged
michalczaplinski merged 1 commit intotrunkfrom Nov 13, 2023
Merged
Image block: Add check for lightbox values during image block migration#56057michalczaplinski merged 1 commit intotrunkfrom
michalczaplinski merged 1 commit intotrunkfrom
Conversation
|
Size Change: +11 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
youknowriad
approved these changes
Nov 13, 2023
Contributor
youknowriad
left a comment
There was a problem hiding this comment.
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.
Member
|
I just cherry-picked this PR to the 6.4-next-point-release branch to get it included in the next release: f42a5ef |
mikachan
pushed a commit
that referenced
this pull request
Nov 13, 2023
mikachan
pushed a commit
that referenced
this pull request
Nov 13, 2023
cbravobernal
pushed a commit
that referenced
this pull request
Nov 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This PR adds a check for the
behaviorsandbehaviors.lightboxattributes 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: