WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#16355 closed defect (bug) (fixed)

Clicking "Apply" in trash view shifts view back to All Items

Reported by: mrmist Owned by: nacin
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

Scenerio -

Trash a post as an admin.
Visit the trash posts page as an author that doesn't have permission to delete said post.
Press "Apply".

The view shifts to the "All" view.
This focus change also seems to happen on "Sticky" view but does not happen for admin user, or when apply is pressed on other views (with nothing selected.)

Not major, but inconsistent UI.
(Tested in Opera)

Attachments (2)

16355.patch (687 bytes) - added by SergeyBiryukov 3 years ago.
16355.2.diff (1.6 KB) - added by nacin 3 years ago.
Includes simplified version of Sergey's patch. show_sticky is boolean.

Download all attachments as: .zip

Change History (10)

comment:1 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1

SergeyBiryukov3 years ago

comment:2 SergeyBiryukov3 years ago

I'm only able to reproduce the issue with “Sticky” view. Here's a patch for that. Is it necessary to select a bulk action before clicking the button?

comment:3 mrmist3 years ago

Is it necessary to select a bulk action before clicking the button?

Not for the cases I've tested.

comment:4 nacin3 years ago

  • Owner set to nacin
  • Status changed from new to accepted

Surprised I missed implementing a hidden field for that. Looks good, testing the other situations now.

comment:5 nacin3 years ago

I can only reproduce on the Trash view when I actually select a bulk action. It has nothing to do with permissions, either.

I'm noticing a few issues:

  • It worked in 3.0. The only reason it did is because -- you'll like this -- the wp_redirect() on line 70 didn't have an exit, and thus the switch was evaluated (with $doaction never set), and then wp_redirect() becomes sendback. That's now fixed, but we should instead when redirect back to $sendback.
  • $post_new_file is set too late in 3.1. Gah.

Patch fixes both.

nacin3 years ago

Includes simplified version of Sergey's patch. show_sticky is boolean.

comment:6 garyc403 years ago

  • Keywords has-patch added

comment:7 garyc403 years ago

nacin's patch works fine.

comment:8 ryan3 years ago

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

(In [17362]) Fix redirects for trashed post bulk ops. Props nacin, SergeyBiryukov. fixes #16355

Note: See TracTickets for help on using tickets.