-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Gallery block: Only show the gallery upload error message if mixed multiple files uploaded #35790
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
Conversation
|
Size Change: +1.18 kB (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
andrewserong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simple fix @glendaviesnz! The logic looks good to me, and confirmed that beforehand, dragging a single video to the editor canvas threw the error. After, there's no error for dragging a single video.
| Before | After |
|---|---|
![]() |
![]() |
Also tested that the error message continues to display when dragging a list of mixed media files (video and image files) to the editor canvas — as on trunk, the files are inserted as File blocks with the error notice appearing.
Dragging image files to create a gallery (either directly into the editor canvas or dragged onto an empty Gallery block) still works correctly, as does dragging onto a gallery with images.
LGTM!
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @glendaviesnz 👍
This tests as advertised for me.
✅ Prior to applying this PR branch I could replicate the issue
✅ No error message is given when a single video is dropped onto the editor canvas
✅ Appropriate error shown when video dropped together with other images onto the canvas
Would it perhaps aid others, or our future selves, to add a tiny comment for this check explaining that it's only intended to catch non-image files when dropped together with images? There's not a lot of difference between the two conditions at a glance.
Completely optional. I'll leave the call up to you.
Good idea - have added that |
|
Thanks for the fix @glendaviesnz! |
* trunk: (494 commits) remove consecutive rc warning (#35855) Update Changelog for 11.8.0-rc.2 Bump plugin version to 11.8.0-rc.2 [RNMobile] Disable React Native E2E Tests (iOS) (#35844) Add section about using the schema during development (#35835) Add a method to disable auto-accepting dialogs (#35828) Wrap NavigationContainer with SafeAreaView. (#35570) Update Appium to 1.22.0 (#35829) Post Comment: Handle the case where a comment does not exist (#35810) Clear selected block when clicking on the gray background (#35816) Post excerpt: Don't print the wrapper when there is no excerpt (#35749) [Block] Navigation: Fix padding for social links on mobile (#35824) Fix issue with responsive navigation causing wrapping. (#35820) [Block Editor]: Fix displaying only `none` alignment option (#35822) Add API to access global settings, styles, and stylesheet (#34843) Mobile Release v1.64.1 (#35804) Add resizer to template part focus mode (#35728) Update Changelog for 11.7.1 Gallery block: Only show the gallery upload error message if mixed multiple files uploaded (#35790) Update Changelog for 11.8.0-rc.1 ...


Description
The error message that was added to cope with image uploads into the refactored gallery is showing even if single files are uploaded, eg. a single video file. This PR adds an additional check to make sure uploaded files are a mix of image and other formats before showing the error
Fixes: #35366
Testing
Screenshots
Before:

After:
