Make WordPress Core

Changeset 49062


Ignore:
Timestamp:
09/27/2020 08:48:05 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Media: Check if the item is defined before setting the skipHistory property in media frame router.

This avoids a JS error when refreshing the "Attachment details" modal for an item that is not currently queried.

Follow-up to [41021].

Props Mista-Flo, mukesh27.
Fixes #51395.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/routers/manage.js

    r49058 r49062  
    4444        // Trigger the media frame to open the correct item.
    4545        item = library.findWhere( { id: parseInt( query, 10 ) } );
    46         item.set( 'skipHistory', true );
    4746
    4847        if ( item ) {
     48            item.set( 'skipHistory', true );
    4949            frame.trigger( 'edit:attachment', item );
    5050        } else {
Note: See TracChangeset for help on using the changeset viewer.