Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 22 months ago

#39780 closed defect (bug) (fixed)

JS error when bulk deleting attachments with MEDIA_TRASH enabled

Reported by: SergeyBiryukov Owned by: wonderboymusic
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords:
Focuses: javascript Cc:


  1. Add define('MEDIA_TRASH', true); to wp-config.php.
  2. Go to Media Library and enable the grid view.
  3. Upload three media files.
  4. Move the newly uploaded files to Trash.
  5. Go to Trash and click "Bulk Select".
  6. Select all the three files and click "Delete Selected".
  7. Only two files are deleted, and there's a JS error in the console:
    Uncaught TypeError: Cannot read property 'get' of undefined
    http://develop.wordpress.dev/src/wp-includes/js/media-views.js?ver=4.8-alpha-39357-src line 3966

Change History (4)

#1 @wonderboymusic
4 years ago

  • Focuses javascript added
  • Milestone changed from Awaiting Review to 4.8
  • Owner set to wonderboymusic
  • Status changed from new to assigned
  • Version set to 4.0

#2 @wonderboymusic
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 40051:

Media: in wp.media.view.DeleteSelectedPermanentlyButton, move destructive async operations outside of the selection loop.

Fixes #39780.

This ticket was mentioned in Slack in #core-media by mike. View the logs.

22 months ago

#4 @mikeschroder
22 months ago

#39532 was marked as a duplicate.

Note: See TracTickets for help on using tickets.