WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#34795 closed defect (bug) (fixed)

Media: missing trash when MEDIA_TRASH set to true

Reported by: afercia Owned by: wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Media Keywords: has-screenshots has-patch ui-feedback
Focuses: ui Cc:

Description

Enable the Media trash in your wp-config.php

define( 'MEDIA_TRASH', true );
  • go in the Media Library > List mode
  • trash an attachment
  • the "Trash" option is missing in the Filter select, see screenshot below

https://cldup.com/mm8KL60tFh.png

As far as I see, introduced in [34256] since $this->is_trash is always false except when explicitly requesting for attachment-filter=trash.

So, the "Trash" option appears just... in the Trash view. In all the other views (All, Images, Audio, etc.) there's the need to check for something else. Previously, there was a check to count the trashed items.

Attachments (2)

34795.diff (701 bytes) - added by chacha102 5 years ago.
Patch for #34795
34795.2.diff (701 bytes) - added by chacha102 5 years ago.
Corrected patch file.

Download all attachments as: .zip

Change History (8)

#1 @chacha102
5 years ago

It doesn't look like the javascript is doing anything fancier than checking if media trash is enabled, and displaying the trash link if it is. So I copied that behavior for the list view.

@chacha102
5 years ago

Patch for #34795

#2 @chacha102
5 years ago

  • Keywords has-patch added; needs-patch removed

@chacha102
5 years ago

Corrected patch file.

#3 @afercia
5 years ago

  • Keywords ui-feedback added

Thanks @chacha102, thinking this is one of the ways to solve the issue (maybe should check just for MEDIA_TRASH) with the disadvantage the "Trash" option would always be displayed even when there are no trashed items. This is different from the previous behavior, not arguing, just saying it requires some UI feedback :)

#4 @chacha102
5 years ago

@afercia Yeah. It is probably worth looking at, considering right now the grid mode will display trash if there isn't anything in it as well.

#5 @afercia
5 years ago

@chacha102 yep, the grid mode select displays all the options (Images, Audio, Video, etc.) even if there are no items. Maybe worth a separate ticket to consider introducing some consistency.

#6 @wonderboymusic
5 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 35752:

Media: show Trash filter for Media list table when MEDIA_TRASH is true.

Props chacha102.
Fixes #34795.

Note: See TracTickets for help on using tickets.