Make WordPress Core

Opened 16 years ago

Closed 15 years ago

Last modified 9 years ago

#8433 closed enhancement (fixed)

Profile contains options that don't apply to users with "subscriber" role

Reported by: jivany's profile jivany Owned by: denis-de-bernardy's profile Denis-de-Bernardy
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: UI Keywords: has-patch
Focuses: Cc:

Description

For a user with the "subscriber" role, the Profile page contains three options under the "Personal Options" heading:

  • Visual Editor
  • Admin Color Scheme
  • Keyboard Shortcuts

"Visual Editor" does not apply to a subscriber as they cannot write posts. This option does not need to be presented to a subscriber.

"Admin Color Scheme" is redundant as the two options presented to the subscriber are the same (both the "bold" and "subtle" colour options are the same).

"Keyboard Shortcuts" does not apply to a subscriber as they are not able to moderate comments.

Observed in Version 2.7-almost-rc-9965

Attachments (4)

8433.diff (1.8 KB) - added by Denis-de-Bernardy 16 years ago.
user-edit.diff (520 bytes) - added by wnorris 15 years ago.
8433.2.diff (687 bytes) - added by ryan 15 years ago.
8433.3.diff (758 bytes) - added by Denis-de-Bernardy 15 years ago.

Download all attachments as: .zip

Change History (27)

#1 @jivany
16 years ago

Whoops. "Admin Color Scheme" behaves the same way for a user with "admin" role (both the "bold" and "subtle" colour options are the same). I'm not sure if this is by design or not.

#2 @kpdesign
16 years ago

  • Cc kpdesign added
  • Component changed from General to UI
  • Keywords admin-ui profile added
  • Owner anonymous deleted

I also would like to see the Personal Options section hidden on the Profile page if the user is assigned to the Subscriber role. There is nothing there that is applicable to a subscriber, and it can be confusing to some users.

#3 @janeforshort
16 years ago

  • Type changed from defect (bug) to enhancement

The admin color scheme palettes just hadn't been updated yet. If someone can see the admin tool at all, they should have the ability to change their color palette selection if they want to.

#4 @kpdesign
16 years ago

I agree Jane about the color palette, but the Visual Editor and Keyboard Shortcuts have no functionality for a user at the Subscriber level, and really should not be displayed on the Profile page to anyone who is assigned that role. Is it possible to get that change worked in to 2.8?

#5 @janeforshort
16 years ago

  • Summary changed from "Dashboard > Profile" Contains options that don't apply to users with "subscriber" role to Profile contains options that don't apply to users with "subscriber" role

If someone will write a patch to remove visual editor and keyboard shortcuts from subscriber role profile, would be nice to have, so users wouldn't wonder what they're for.

#6 @janeforshort
16 years ago

  • Keywords options needs-patch added; admin-ui removed
  • Milestone changed from 2.8 to Future Release

Punting due to feature freeze. Reconsider with next release.

#7 @Denis-de-Bernardy
16 years ago

  • Keywords has-patch tested commit added; profile options needs-patch removed
  • Milestone changed from Future Release to 2.8

#8 @Denis-de-Bernardy
16 years ago

  • Owner set to Denis-de-Bernardy
  • Status changed from new to accepted

#9 @westi
16 years ago

Patch broken by change to just use the IS_PROFILE_PAGE in [11359], once fixed works a treat.

#10 @westi
16 years ago

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

(In [11447]) Hide options from users when they don't make any sense for them. Fixes #8433 props Denis-de-Bernardy.

#11 @wnorris
15 years ago

  • Keywords tested commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

the capabilities 'edit_post' and 'edit_page' expect to be passed a specific post ID. If absent you get notices like:
Notice: Trying to get property of non-object in .../wp-includes/capabilities.php on line 822

The correct capabilities to use are 'edit_posts' and 'edit_pages' (plural). Patch attached.

@wnorris
15 years ago

#12 follow-up: @ryan
15 years ago

The all_post_types filter used in other places. We should drop the filter here since posts and pages (with the "s") aren't post types.

@ryan
15 years ago

#13 @ryan
15 years ago

Quick, untested patch.

#14 in reply to: ↑ 12 @Denis-de-Bernardy
15 years ago

Replying to ryan:

The all_post_types filter used in other places. We should drop the filter here since posts and pages (with the "s") aren't post types.

Where? I had checked before adding it. :-)

#15 @Denis-de-Bernardy
15 years ago

Just for info, the reason I had used post and page, rather than posts and pages, was that these filters worked too (I must confess I hadn't checked for the notice), and that made sense to filter that thingy so as to allow plugins to add custom post types if needed.

#16 @ryan
15 years ago

Actually, it's hierarchical_post_types I was remembering. Regardless, these aren't post types.

#17 follow-up: @ryan
15 years ago

How about leaving the filter off for now and adding some generic post type registration in 2.9? There are several places where that would be handy.

#18 @Denis-de-Bernardy
15 years ago

third patch is up with a slightly different approach.

#19 in reply to: ↑ 17 @Denis-de-Bernardy
15 years ago

Replying to ryan:

How about leaving the filter off for now and adding some generic post type registration in 2.9? There are several places where that would be handy.

Works too, if you don't want it around immediately. In that case, we'd commit 8433.2.diff, and get meet up IRC in early 2.9 to work out where we want them, and ensure we've consistent filter names across the board.

#20 @Denis-de-Bernardy
15 years ago

Sheesh, it's getting late over here. I can barely write english anymore, and I'm still coding. :D

#21 @ryan
15 years ago

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

(In [11477]) Fix notice. Props wnorris. fixes #8433

#22 @ryan
15 years ago

Went with the most conservative fix for 2.8.

This ticket was mentioned in Slack in #core-fields by helen. View the logs.


9 years ago

Note: See TracTickets for help on using tickets.