Make WordPress Core

Opened 9 months ago

Closed 9 months ago

#64344 closed defect (bug) (worksforme)

gutenberg_block_core_image_render_lightbox undefined $img_srcset

Reported by: donbowman Owned by:
Priority: normal Milestone:
Component: Interactivity API Version: 6.9
Severity: normal Keywords:
Cc: Focuses:

Description

in wordpress 6.9, gutenberg_block_core_image_render_lightbox(), line 224 (setting wp_interactivity_state), I am getting "Undefined variable $img_srcset in /app/wp-content/plugins/build/scripts/block-library/image.php on line 224"

In turn this is "'lightboxSrcset' => $img_srcset," in setting the $unique_image_id array.

img_srcset is not set to a default in the function, and i think this therefore implies that the speciic page has the $blockattrsid not set, so it doesn't add the value.

i am not sure if it should bail out, or, if there is a default that would make sense.

Change History (2)

#1 @donbowman
9 months ago

The block which causes this is below.

Array
(
    [blockName] => core/image
    [attrs] => Array
        (
            [width] => 375px
            [sizeSlug] => large
            [linkDestination] => none
            [align] => right
        )

    [innerBlocks] => Array
        (
        )

    [innerHTML] =>
<figure class="wp-block-image alignright size-large is-resized"><img src="https://www.agilicus.com/www/1e428847-image-965x1024.png" alt="" style="width:375px"/></figure>

    [innerContent] => Array
        (
            [0] =>
<figure class="wp-block-image alignright size-large is-resized"><img src="https://www.agilicus.com/www/1e428847-image-965x1024.png" alt="" style="width:375px"/></figure>

        )

)

#2 @swissspidy
9 months ago

  • Milestone Awaiting Review
  • Resolutionworksforme
  • Status newclosed

Hi there,

Please note that issues with the Gutenberg plugin should be reported on GitHub.

Looks like this particular bug was already reported though and fixed in version 22.2 (released today), see https://github.com/WordPress/gutenberg/pull/73453

Note: See TracTickets for help on using tickets.