WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#27951 closed defect (bug) (fixed)

When an attachment is edited by another user the sendback url doesn't work

Reported by: knutsp Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.6
Component: Posts, Post Types Keywords: has-patch
Focuses: administration Cc:

Description

When an attachment is being edited and another user tries to edit it, the last user is presented with a dialog containing three choices, Media, Preview or Take over.

The Media button takes you to edit.php?post_type=attachment. This page shows an empty list table. The correct page would be upload.php.

Attachments (1)

27951.diff (424 bytes) - added by knutsp 7 years ago.

Download all attachments as: .zip

Change History (12)

#1 @knutsp
7 years ago

  • Keywords needs-patch added

I may try to have a patch ready in a few days.

#2 follow-ups: @johnbillion
7 years ago

  • Milestone changed from Awaiting Review to Future Release

Related: edit.php?post_type=attachment should probably redirect to upload.php.

#3 in reply to: ↑ 2 @DrewAPicture
7 years ago

Replying to johnbillion:

Related: edit.php?post_type=attachment should probably redirect to upload.php.

If we add the redirect, I'd only request that we take a similar approach to what we did in [25453].

#4 in reply to: ↑ 2 ; follow-up: @knutsp
7 years ago

  • Keywords dev-feedback added

Replying to johnbillion:

Related: edit.php?post_type=attachment should probably redirect to upload.php.

I agree with this approach. I'm not sure how to patch it this way, so help needed.

#5 in reply to: ↑ 4 @DrewAPicture
7 years ago

Replying to knutsp:

Replying to johnbillion:

Related: edit.php?post_type=attachment should probably redirect to upload.php.

I agree with this approach. I'm not sure how to patch it this way, so help needed.

Hi knutsp. I'd suggest taking a look at the redirect logic for the 'attachment' post type in post-new.php. You should be able to handle it in basically the same way in edit.php.

@knutsp
7 years ago

#6 @knutsp
7 years ago

  • Keywords has-patch added; needs-patch removed

The first paragraph of this ticket's description should read:

When an attachment is being edited by a user, and then has been taken over by another user, the first user is presented with a dialog that informs of this takeover, and contains one button, Media.

#7 @wonderboymusic
7 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Future Release to 4.0

I moved the redirect farther up, but this looks good.

#8 @wonderboymusic
7 years ago

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

In 28729:

edit.php?post_type=attachment should redirect to upload.php. Without the redirect, the user is presented with an empty list table. There are probably other issues to address overall, but this accomplishes what the ticket wants.

Props knutsp.
Fixes #27951.

#9 follow-up: @kovshenin
7 years ago

In r28729, why are we checking the return value of wp_redirect()? It's always true unless it's filtered.

#10 in reply to: ↑ 9 @DrewAPicture
7 years ago

Replying to kovshenin:

In r28729, why are we checking the return value of wp_redirect()? It's always true unless it's filtered.

I believe that's actually the point of checking -- otherwise we'd exit regardless of whether the filter returns true or false. See also [25453] for context.

#11 @nacin
7 years ago

I hate what's done in [25453] generally speaking, but there are limited situations where it is not the worst thing in the world. [28729] is one of them.

Note: See TracTickets for help on using tickets.