Opened 19 months ago
Closed 19 months ago
#59597 closed defect (bug) (fixed)
Fix: Stop crashing with Lightbox on image blocks without an image.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | 6.4 |
Component: | Editor | Keywords: | has-patch gutenberg-merge |
Focuses: | Cc: |
Description (last modified by )
Resolves https://github.com/WordPress/gutenberg/pull/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.
Change History (9)
This ticket was mentioned in PR #5461 on WordPress/wordpress-develop by @dmsnell.
19 months ago
#1
#3
@
19 months ago
- Description modified (diff)
Modifying to provide a link back to Gutenberg, as the previous linked to Trac.
@hellofromTonya commented on PR #5461:
19 months ago
#4
Hey @dmsnell, is https://github.com/WordPress/gutenberg/pull/55217 the correct link back to the issue in Gutenberg? They seem unrelated.
19 months ago
#5
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
19 months ago
#6
Closing since this has been incorporated into Gutenberg and will come over in the next package update.
Trac ticket: Core-59597
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.