Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#17419 closed defect (bug) (fixed)

Authors see misleading links in media library

Reported by: johnbillion Owned by: nacin
Priority: normal Milestone: 3.3
Component: Administration Version: 3.1
Severity: minor Keywords: has-patch tested dev-feedback
Cc: Focuses:

Description

Visit the Media Library while logged in as an Author and you'll see each media item's title is a link (with a title attribute of "Edit [title]"), but this link takes you straight back to the media library as you don't have the required capability to edit media items.

Affects 3.1 and trunk.

Attachments (4)

17419.diff (2.8 KB ) - added by solarissmoke 15 years ago.
Check permissions before showing various edit links in media library
17419.formatted.diff (3.0 KB ) - added by kirasong 15 years ago.
A bit of formatting to make the code easier to read
17419.formatted.1.diff (3.1 KB ) - added by kurtpayne 15 years ago.
17419.bug.png (87.1 KB ) - added by kurtpayne 15 years ago.
Bug fixed by 17419.formatted.1.diff

Download all attachments as: .zip

Change History (18)

#1 @scribu
15 years ago

  • Component Role/CapabilityAdministration
  • Keywords needs-patch added
  • Milestone Awaiting ReviewFuture Release

#2 @solarissmoke
15 years ago

  • Keywords has-patch added; needs-patch removed
  • Version3.1

Same applies for the link on the image thumbnail, the Attach link, and the link to edit the parent post (if attached). See patch.

@solarissmoke
15 years ago

Check permissions before showing various edit links in media library

#3 @SergeyBiryukov
15 years ago

  • Milestone Future Release3.3

#4 @johnpbloch
15 years ago

Tested on trunk. Works fine for me.

@kirasong
15 years ago

A bit of formatting to make the code easier to read

#5 @kirasong
15 years ago

Tested, and still works for me on trunk. Uploaded version with a bit of formatting cleanup if desired.

#6 @kirasong
15 years ago

  • Cc mike.schroder@… added

@kurtpayne
15 years ago

Bug fixed by 17419.formatted.1.diff

#7 @kurtpayne
15 years ago

  • Cc kpayne@… added

Looks like there's a bug when mixing images that are owned by an author and images that are not owned by an author. For example, see 17419.bug.png. The user "author" uploaded an image, futurama_14, that shows a checkbox and the appropriate edit, delete, and attach links. However, the "author" user is also given checkboxes and attach links for other images.

It looks like the $post object is being reset by The Loop in display_rows() function. Patch 17419.formatted.1.diff should fix this by resetting $user_can_edit after the loop.

Let me know if I missed anything!

#8 @olleicua
15 years ago

  • Cc olleicua@… added

tested on Revision #19107. Before patch the attach link was displayed, after it was not. Looks pretty solid. Also some nice cleanup to make the code more readable.

+1

Last edited 15 years ago by olleicua (previous) (diff)

#9 @kcristiano
15 years ago

tested on Revision 19193. Works as described

#11 @nacin
15 years ago

  • Owner set to nacin
  • Status newaccepted

#12 @edwardw
15 years ago

  • Keywords tested added

Tested on r19236 and works as expected.

#13 @edwardw
15 years ago

  • Keywords dev-feedback added

#14 @ryan
15 years ago

  • Resolutionfixed
  • Status acceptedclosed

In [19252]:

Check caps when showing media edit and attach links. Clean up formatting. Props kurtpayne, DH-Shredder, solarissmoke. fixes #17419

Note: See TracTickets for help on using tickets.