Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image: Lightbox doesn't work on image inserted from URL #51276

Closed
ajlende opened this issue Jun 6, 2023 · 1 comment · Fixed by #51278
Closed

Image: Lightbox doesn't work on image inserted from URL #51276

ajlende opened this issue Jun 6, 2023 · 1 comment · Fixed by #51278
Assignees
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@ajlende
Copy link
Contributor

ajlende commented Jun 6, 2023

Description

Getting PHP errors when using the lightbox with images not in the media library.

( ! ) Notice: Undefined index: id in ./gutenberg/build/block-library/blocks/image.php on line 81

This happens in both the post editor and the frontend.

Step-by-step reproduction instructions

  1. Add an image block
  2. Use 'Insert from URL' to add an image
  3. See PHP error

Or use the image block below.

<!-- wp:image {"sizeSlug":"large","behaviors":{"lightbox":true}} -->
<figure class="wp-block-image size-large"><img src="https://wp20.wordpress.net/wp-content/themes/twentyseventeen-wp20/images/wp20-logo-white.svg" alt="WP20 logo"/></figure>
<!-- /wp:image -->

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@SantosGuillamot
Copy link
Contributor

I started this pull request to solve it. Thanks a lot for the report 🙂

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants