Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30457 closed defect (bug) (fixed)

Media Library: Bulk Selected images in grid view only partially deleted

Reported by: ansiman Owned by: wonderboymusic
Milestone: 4.1 Priority: normal
Severity: major Version: 4.0.1
Component: Media Keywords: has-patch commit fixed-major
Focuses: javascript Cc:


This must have been introduced with 4.0.1 as it was working with 4.0.0.

When you select images for deletion in the Media Library in grid view and click on delete, not all selected images are deleted.

In my test installation I uploaded 5 images. Selecting all of them and clicking delete removes 3 and leaves two. Clicking those 2 again and clicking delete removes 1 and leaves 1. Selecting the last image again and clicking delete removes the last image.

This might be related to the fix introduced with #29597.

Attachments (1)

30457.patch (408 bytes) - added by 5um17 6 years ago.
Patch to fix the issue

Download all attachments as: .zip

Change History (9)

#1 @ansiman
6 years ago

It seems that somehow only every other image is actually deleted. Selecting 8 images for deletion leaves 4 images after deletion. Selecting those for leaves 2, selecting the 2 leaves 1 etc...

6 years ago

Patch to fix the issue

#2 @5um17
6 years ago

  • Focuses javascript added
  • Keywords has-patch added
  • Severity changed from normal to major

Destroy method was not sending ajax call for every media attachment, passing {wait: true} in destroy function fix the issue.
I am not so good with backbone js, is it the correct way ?

#3 @ocean90
6 years ago

  • Milestone changed from Awaiting Review to 4.0.2
  • Owner set to wonderboymusic
  • Status changed from new to reviewing

#4 @wonderboymusic
6 years ago

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

In 30638:

When deleting media grid attachments, wait until the server responds before removing the model from its collection.

Props 5um17.
Fixes #30457.

#5 @wonderboymusic
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for 4.0.2

#6 @helen
6 years ago

  • Keywords commit fixed-major added

This ticket was mentioned in Slack in #core by kimparsell. View the logs.

6 years ago

#8 @nacin
6 years ago

  • Milestone changed from 4.0.2 to 4.1
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.