-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gallery Block: Adding images to gallery removes all existing images #33769
Comments
Thanks for reporting. I could reproduce this. There also seems to be a bug with the Gutenberg plugin where the file picker is opened every time I click the Media Library button. 🤔 |
Thanks! This was also reported on Trac 53835. |
I've been able to reproduce this issue. I've also found a workaround:
|
Still not sure why it isn't pulling the right attachments from the previous gallery, but I found that the view only contains the new entries before rendering the new modal instead of pulling the previous collection too. It may be related to the trigger chaining and the necessity to pull the entries from Edit gallery and appending them as Attachments in the corresponding view. |
With WordPress 5.8.1 RC due out in less than 24 hours and no proposed fix, I've moved this to the 5.8.2 milestone. |
The issue of the file picker opening is noted in this issue #34099 - initially closed thinking it was a duplicate of this one, but probably worth listing as a separate issue in case it is a separate fix to the issue of the existing images being lost |
I've come up with a fix in #35070 that should resolve this issue — it's a bit of a workaround due to how the GalleryAdd controller works in the media library, but hopefully it restores the expected behaviour. |
Is there an existing issue for this?
Have you tried deactivating all plugins except Gutenberg?
Have you tried replicating the bug using a default theme e.g. Twenty Twenty?
Description
When adding images to an existing gallery block, any existing images disappear. I have verified that this issue was introduced in 5.8. I tested on the same site prior to upgrading from 5.7 and it worked as expected.
This appears to be an issue with the
<MediaUpload>
component as I found the bug when I was working on my own block using that component.Step-by-step reproduction instructions
Expected Behavior
Would expect that adding to gallery retains the existing images
Current Behavior
When adding to the gallery the existing images disappear
IF you visit the Edit Gallery screen prior to adding images, it works as expected, though that's not an intuitive workflow..
Screenshots or screen recording (optional)
Code snippet (optional)
No response
WordPress Information
WP 5.8
Gutenberg Information
Gutenberg not installed
What browsers are you seeing the problem on?
Chrome
Device Information
Desktop
Operating System Information
MacOS 11.4
The text was updated successfully, but these errors were encountered: