[wp-trac] [WordPress Trac] #59597: Fix: Stop crashing with Lightbox on image blocks without an image.
WordPress Trac
noreply at wordpress.org
Wed Oct 11 16:41:19 UTC 2023
#59597: Fix: Stop crashing with Lightbox on image blocks without an image.
--------------------------+---------------------
Reporter: dmsnell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.4
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+---------------------
Old description:
> 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.
New description:
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.
--
Comment (by hellofromTonya):
Modifying to provide a link back to Gutenberg, as the previous linked to
Trac.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59597#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list