Fix: Stop crashing with Lightbox on image blocks without an image.#5461
Closed
dmsnell wants to merge 1 commit intoWordPress:trunkfrom
Closed
Fix: Stop crashing with Lightbox on image blocks without an image.#5461dmsnell wants to merge 1 commit intoWordPress:trunkfrom
dmsnell wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Resolves WordPress/gutenberg#55217 When rendering images with the lightbox "expand on click" function enabled, if an image block is encountered with no image (for example, a block was added but no image was ever selected), then WordPress would create a warning that an "undefined array key 0" was being accessed because the server code assumes an IMG element exists in the block's HTML. In this patch a check is performed to ensure that an IMG block exists before processing the block. If one isn't, for any reason, the original given HTML for the block is passed through un-modified. This patch needs to be backported into Gutenberg from where it's sourced but this issue arose during the WordPress 6.4 beta testing and needs to be resolved immediately in Core.
103c67c to
770586a
Compare
Contributor
|
Hey @dmsnell, is WordPress/gutenberg#55217 the correct link back to the issue in Gutenberg? They seem unrelated. |
Member
Author
|
thank you @hellofromtonya - correct, that was a mistake. I've updated the description to point to the right issue now, which is 55214 and not 55217 |
Member
Author
|
Closing since this has been incorporated into Gutenberg and will come over in the next package update. |
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.
Trac ticket: Core-59597
Resolves WordPress/gutenberg#55214
When rendering images with the lightbox "expand on click" function enabled, if an image block is encountered with no image (for example, a block was added but no image was ever selected), then WordPress would create a warning that an "undefined array key 0" was being accessed because the server code assumes an IMG element exists in the block's HTML.
In this patch a check is performed to ensure that an IMG block exists before processing the block. If one isn't, for any reason, the original given HTML for the block is passed through un-modified.
This patch needs to be backported into Gutenberg from where it's sourced but this issue arose during the WordPress 6.4 beta testing and needs to be resolved immediately in Core.