Opened 21 months ago
Last modified 4 days ago
#61057 assigned defect (bug)
Media Library not showing new uploads when filtering by date
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | 6.5 |
| Component: | Media | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Description
The issue can be reproduced in the media library, in grid mode. As soon as the value of the date filter is modified, new uploads will not be displayed in the grid until the user refreshes the page or modifies the date filter.
This issue appears to be similar to: https://core.trac.wordpress.org/ticket/50025
Environment
- WordPress: 6.5.3-alpha-58036
- PHP: 8.2.18
- Server: Apache
- Database: mysqli (Server: 5.7.44 / Client: mysqlnd 8.2.18)
- Browser: Chrome 124.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Four 1.1
- MU-Plugins: Aucune activée
- Plugins:
- WordPress Beta Tester 3.5.5
Steps to Reproduce
- Use grid mode in Media Library
- Filter by a date (eg. April 2024)
- Toggle back to "All Dates"
- Upload a media by drag-and-dropping an image into the grid
The new image will not appear in the grid unless I refresh the page or select the current date in the date filter (eg. April 2024)
Expected Results
There should be some visual feedback when uploading the media. Normally, the image should appear in the grid, and it should display a loading bar while it is being uploaded.
Actual Results
There is no visual feedback when uploading the media. The image does not appear in the grid at all, unless I refresh the page or filter the grid by the current date.
Attachments (5)
Change History (15)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
21 months ago
#2
@
21 months ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 6.6
- Owner set to antpb
- Status changed from new to assigned
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
20 months ago
#4
@
20 months ago
- Milestone changed from 6.6 to 6.7
As the other related issue has been punted to 6.7 we're going to need to do the same here. Moving to 6.7 to allow more time
#7
@
17 months ago
As per testing instructions, I am also able to reproduce the issue on WordPress 6.6.1.
Here is the process and result, https://d.pr/v/GGefxc
#8
@
16 months ago
- Milestone changed from 6.7 to Future Release
As the related issue, #54091, has been moved off the 6.7 milestone, this one will need to be moved too.
This ticket was mentioned in PR #10745 on WordPress/wordpress-develop by @rutviksavsani.
4 days ago
#9
- Keywords has-patch added; needs-patch removed
## Changes
This PR implements two minimal changes to resolve the issue:
- Add date filter functions (
src/js/media/models/attachments.js)
Added year and monthnum filter functions to the static Attachments.filters object (lines 598-657). These functions validate attachments against year/month filter criteria
### 2. Updated allowed args whitelist (src/js/media/models/query.js)
Added 'year' and 'monthnum' to the allowed args array so Query collections observe the upload queue when date filters are active.
Trac ticket: https://core.trac.wordpress.org/ticket/61057
This relates a bit to the work happening in https://core.trac.wordpress.org/ticket/54091
I'm going to look into if this can be solved alongside it. Moving to 6.6 to investigate.
A potential partial solution mentioned by @joedolson was that we could maybe solve this for most people by initializing if the current pagination count is less than 81 items. In that case, we could reinitialize the collection safely.