WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#29145 closed task (blessed) (fixed)

MEDIA_TRASH audit for Media Grid

Reported by: wonderboymusic Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords: needs-patch
Focuses: javascript, administration Cc:

Description

I noticed a few places last night, there may be more:

  • The "Trash" link in the Edit Attachment modal is left-aligned, "Delete" is right-aligned
  • Once you trash an item, there should be a "Trash" filter in the "all" dropdown. The link in the modal will then be "Untrash." This would introduce more parity with the list table. Otherwise, you can never view your trash'd media in the grid.

Attachments (2)

29145.diff (15.5 KB) - added by wonderboymusic 4 years ago.
29145.2.diff (17.0 KB) - added by wonderboymusic 4 years ago.

Download all attachments as: .zip

Change History (8)

#1 @wonderboymusic
4 years ago

Delete/Trash Scenarios:

No. 1

  • Open the Media Grid
  • Click an item to open the modal
  • Click "Delete"
  • Modal closes
  • Item is not in library
  • Refresh the page: item is not there

No. 2

  • add define( 'MEDIA_TRASH', true ) to wp-config.php
  • Open the Media Grid
  • Click an item to open the modal
  • Click "Trash"
  • Modal closes
  • Item is not in library
  • Refresh the page: item is not there

No. 3

  • add define( 'MEDIA_TRASH', true ) to wp-config.php
  • Open the Media Grid
  • Select "Trash" from the filters dropdown
  • Click an item to open the modal
  • Click "Untrash"
  • Modal closes
  • Item is in library
  • Refresh the page: item is there (In "All Media Items", not "Trash")

No. 4

  • Remove define( 'MEDIA_TRASH', true ) to wp-config.php
  • Open the Media Grid
  • Click "Bulk Select"
  • Click two items to select them
  • Click "Delete Selected"
  • Confirm both items are removed
  • Confirm that "Trash" is not an available filter
  • Refresh the page, both items are gone

No. 5

  • Add define( 'MEDIA_TRASH', true ) to wp-config.php
  • Open the Media Grid
  • Click "Bulk Select"
  • Click two items to select them
  • Click "Trash Selected"
  • Confirm both items are removed
  • Confirm that "Trash" is an available filter
  • Select the "Trash" filter, confirm that both items are there
  • Refresh the page, confirm the items are not in the library
  • Select the "Trash" filter, confirm that both items are there

No. 6

  • Add define( 'MEDIA_TRASH', true ) to wp-config.php
  • Open the Media Grid
  • Click "Bulk Select"
  • Click two items to select them
  • Click "Trash Selected"
  • Confirm both items are removed
  • Confirm that "Trash" is an available filter
  • Select the "Trash" filter, confirm that both items are there
  • Click "Bulk Select"
  • Select an item
  • Click "Untrash Selected"
  • Confirm that item is removed from Trash
  • Select the "All Media Items" filter
  • Confirm that the item is present
  • Select the "Trash" filter
  • Confirm the item is not present

@wonderboymusic
4 years ago

#2 @wonderboymusic
4 years ago

just had a 3.5 hour chat with Koop - media.view.Attachment.trashAttachment() works in the sense that, yes, it properly trashes the item on the backend, but this is only reflected in mirrored attachment collections when media.model.Attachments.validateDestroyed is set to true. That's fine. It can be toggled via settings.mediaTrash.

The remaining issue is when a Trashed item is Untrashed. The mirrored collections are not updating properly. This will require some more digging when I arise.

Zzzzzzzzzzz.

#3 @wonderboymusic
4 years ago

In 29491:

Media Grid, support MEDIA_TRASH:

  • Only use the special trashAttachment logic when in edit-metadata mode.
  • Don't support the trash filter in the Add Media modal for now.
  • Properly toggle trash/untrash logic in the Attachment Details sidebar

See #29145.

#4 @wonderboymusic
4 years ago

In 29492:

Media Grid, support MEDIA_TRASH: add AYS to bulk actions.

See #29145.

#5 @wonderboymusic
4 years ago

[29490] missed the ticket

#6 @wonderboymusic
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.