mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Remove caching from filter by date in media library.
Previously, newly uploaded media attachments were missing when filtering media items by date due to lack of cache invalidation. Props adamsilverstein, teamdnk, afercia, Mista-Flo, joedolson. Fixes #50025. git-svn-id: https://develop.svn.wordpress.org/trunk@50021 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9983be3248
commit
f8829b3a8d
@ -243,13 +243,11 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
|
||||
var args = {},
|
||||
orderby = Query.orderby,
|
||||
defaults = Query.defaultProps,
|
||||
query,
|
||||
cache = !! props.cache || _.isUndefined( props.cache );
|
||||
query;
|
||||
|
||||
// Remove the `query` property. This isn't linked to a query,
|
||||
// this *is* the query.
|
||||
delete props.query;
|
||||
delete props.cache;
|
||||
|
||||
// Fill default args.
|
||||
_.defaults( props, defaults );
|
||||
@ -288,14 +286,7 @@ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{
|
||||
// Substitute exceptions specified in orderby.keymap.
|
||||
args.orderby = orderby.valuemap[ props.orderby ] || props.orderby;
|
||||
|
||||
// Search the query cache for a matching query.
|
||||
if ( cache ) {
|
||||
query = _.find( queries, function( query ) {
|
||||
return _.isEqual( query.args, args );
|
||||
});
|
||||
} else {
|
||||
queries = [];
|
||||
}
|
||||
queries = [];
|
||||
|
||||
// Otherwise, create a new query and add it to the cache.
|
||||
if ( ! query ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user