Ticket #6907 (new defect)

Opened 4 months ago

Last modified 1 month ago

A bug in /wp-admin/menu.php

Reported by: CrazySerb Assigned to: anonymous
Priority: high Milestone: 2.7
Component: General Version: 2.5.1
Severity: normal Keywords: menu.php has-patch
Cc:

Description

There's an obvious (at least to me) bug in the menu.php file on line 26, and it should read:

$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>$awaiting_mod</span></span>" ), 'moderate_comments', 'edit-comments.php');

(I just replaced the 'edit_posts' with 'moderate_comments' and it's working the way it should now, as in, those users who do not have moderate_comments role assigned to them cannot see the Comments link in the navigation menu)

Attachments

patch.diff (0.9 kB) - added by MattyRob on 07/03/08 20:15:03.

Change History

06/25/08 03:23:25 changed by DD32

  • milestone set to 2.6.

07/03/08 20:14:44 changed by MattyRob

  • keywords changed from menu.php to menu.php has-patch.

Attaching a patch file for this bug so it's easier to commit

07/03/08 20:15:03 changed by MattyRob

  • attachment patch.diff added.

07/17/08 15:24:23 changed by MattyRob

  • milestone changed from 2.9 to 2.6.1.

I think we should fix this asap. There is a more appropriate capability defined so let's use it. With a patch attached there is no to delay committing it after a quick test to make sure I haven't broken anything with the patch!

07/17/08 16:07:11 changed by ryan

moderate_comments is rarely and inconsistently used. edit-comments.php/comment.php do not use it when checking to see if the comment can be moderated. They use edit_post. About the only place that uses moderate_comments is admin-ajax.php. Further, is deleting a comment considered moderation? Currently it is not considered moderation and is not protected by a moderate_comments check. edit-comments.php must still be available in the menu for the comment to be deleted, however. The whole thing needs to be cleaned up before messing the menu.php. We may need to create a new set of meta caps: edit_comment, delete_comment, and moderate_comment.

08/03/08 18:17:49 changed by mattyrob

  • milestone changed from 2.6.1 to 2.7.

@Ryan,

I take all your points there. let's bump this back to a later version but not forget about it.

The functions, actions, filters and capabilities throughout the code really do need to be consistent, well used and well documented