WordPress.org

Make WordPress Core

Changeset 50021


Ignore:
Timestamp:
01/26/2021 05:24:15 AM (8 months ago)
Author:
antpb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/models/query.js

    r48650 r50021  
    244244                orderby  = Query.orderby,
    245245                defaults = Query.defaultProps,
    246                 query,
    247                 cache    = !! props.cache || _.isUndefined( props.cache );
     246                query;
    248247
    249248            // Remove the `query` property. This isn't linked to a query,
    250249            // this *is* the query.
    251250            delete props.query;
    252             delete props.cache;
    253251
    254252            // Fill default args.
     
    289287            args.orderby = orderby.valuemap[ props.orderby ] || props.orderby;
    290288
    291             // Search the query cache for a matching query.
    292             if ( cache ) {
    293                 query = _.find( queries, function( query ) {
    294                     return _.isEqual( query.args, args );
    295                 });
    296             } else {
    297                 queries = [];
    298             }
     289            queries = [];
    299290
    300291            // Otherwise, create a new query and add it to the cache.
Note: See TracChangeset for help on using the changeset viewer.