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

MediaUpload: cannot edit selected image in Add to Gallery view of media library #38363

Open
ramonjd opened this issue Jan 31, 2022 · 1 comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended

Comments

@ramonjd
Copy link
Member

ramonjd commented Jan 31, 2022

Description

Selecting an image and clicking on Edit Image in the Gallery Block Media Library throws a JS error.

The error is thrown at this line: https://github.com/WordPress/wordpress-develop/blob/2648a5f984b8abf06872151898e3a61d3458a628/src/js/media/views/edit-image.js#L25.

Step-by-step reproduction instructions

  1. Insert a Gallery Block and add some images.
  2. Select the Gallery Block
  3. Click "Add" in the toolbar to open the Media Library
  4. Select an image so that it has a blue border
  5. Click on Edit Image

Screenshots, screen recording, code snippet

Jan-31-2022 16-05-31

Environment info

  • WordPress 5.9
  • Gutenberg trunk

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

@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended [Block] Gallery Affects the Gallery Block - used to display groups of images labels Jan 31, 2022
@ramonjd
Copy link
Member Author

ramonjd commented Aug 30, 2022

Error in the console:

media-views.js?ver=6.1-alpha-53944:5375 Uncaught TypeError: Cannot read properties of undefined (reading 'toJSON')
    at n.prepare (media-views.js?ver=6.1-alpha-53944:5375:21)
    at n.render (wp-backbone.js?ver=6.1-alpha-53944:534:20)
    at n.editState (index.js:139:8)
    at p (backbone.min.js?ver=1.4.1:2:3736)
    at f (backbone.min.js?ver=1.4.1:2:3533)
    at a (backbone.min.js?ver=1.4.1:2:692)
    at e.trigger (backbone.min.js?ver=1.4.1:2:3423)
    at StateMachine.<computed> [as trigger] (media-views.js?ver=6.1-alpha-53944:2105:25)
    at Region.trigger (media-views.js?ver=6.1-alpha-53944:1777:21)
    at Region.render (media-views.js?ver=6.1-alpha-53944:1723:8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant