Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#18085 closed defect (bug) (fixed)

Notice: Undefined index: in /var/www/wp-admin/includes/menu.php on line 219

Reported by: ansimation's profile ansimation Owned by: ryan's profile ryan
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

When a new role is created with no capabilities that allow the user to view the back end like so ( added to end of functions.php for twentyeleven theme. ):

add_action( 'init', 'add_new_roles' );
function add_new_roles(){
    add_role( 'new_role', 'New Role', array( 'read', 'foo' ) );
}

create a new user with the 'new role' and then log out and log back in as this user. with WP_DEBUG set to true it shows the message saying you do not have permissions to view the page but then there's a notice above it saying Notice: Undefined index: in /var/www/wp-admin/includes/menu.php on line 219.

I just did a new svn checkout and tried it with the twentyeleven theme to be sure it wasn't something that I did and it still did it.

patch attached

Attachments (2)

menu.php.diff (785 bytes) - added by ansimation 13 years ago.
patch for menu.php
18085.patch (530 bytes) - added by SergeyBiryukov 13 years ago.
More simple patch

Download all attachments as: .zip

Change History (7)

@ansimation
13 years ago

patch for menu.php

#1 @ocean90
13 years ago

  • Keywords has-patch 3.3-early added
  • Milestone changed from Awaiting Review to Future Release

Same message on user admin dashboard in Multisite.

#2 @SergeyBiryukov
13 years ago

  • Milestone changed from Future Release to 3.3

#3 @ocean90
13 years ago

  • Component changed from Role/Capability to Menus
  • Keywords 3.3-early removed

Duplicate: #18533

@SergeyBiryukov
13 years ago

More simple patch

#4 @ryan
13 years ago

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

In [18740]:

Avoid notice with empty menu. Props ansimation, SergeyBiryukov. fixes #18085

#5 @c3mdigital
11 years ago

#18327 was marked as a duplicate.

Note: See TracTickets for help on using tickets.