Opened 4 years ago
Closed 4 years ago
#52789 closed defect (bug) (fixed)
Gallery layout block adds all media items when changing an image
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 5.7.1 | Priority: | normal |
Severity: | normal | Version: | 5.7 |
Component: | Editor | Keywords: | needs-patch |
Focuses: | Cc: |
Description
## Steps to reproduce:
- Have multiple items already added to the media library.
- Create a new post
- Drag a the Gallery pattern (two images side by side)
- Select one image
- Click media library
- Select ONE image
- Click Add to gallery
- All images are selected
- Click update gallery
- All images are added to the gallery
## Expected behaviour
Only one image is added to the gallery
I'm not sure whether the bug is in the block or the media library. There were no errors or warnings in the JS Console
Running WordPress under 'wplocal' (flywheel/wpengine).
PHP 7.4.1
Browser: Chrome 88.0.4324.192
Video demo of the issue: https://vimeo.com/522746498/0ca3c5a137
Change History (8)
#1
@
4 years ago
- Component changed from General to Editor
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 5.7.1
This ticket was mentioned in Slack in #core-editor by desrosj. View the logs.
4 years ago
#3
@
4 years ago
I've created https://github.com/WordPress/gutenberg/issues/29835 and https://github.com/WordPress/gutenberg/issues/29834 upstream for these issues. Going to leave this open for now for tracking purposes.
Good catch on this one!
I did some testing, and looks like this is reproducible in
trunk
as well. However, it only happens if the original two images are in the gallery. For example, if you replace one of the images and then click Media Library as seen in the video, the issue does not occur.My hunch is that it has something to do with both IDs being
null
in the block definition (<!-- wp:gallery {"ids":[null,null],"linkTo":"none","align":"wide"} -->
is what gets inserted).Some other things I noticed:
This will probably need an issue over on GitHub, but leaving this open for now for visibility.