WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14010 closed defect (bug) (fixed)

PHP Notice: Undefined index in /wp-admin/plugins.php on line 16

Reported by: jorbin Owned by: nacin
Milestone: 3.1 Priority: normal
Severity: trivial Version: 3.0
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

the $menu_permsplugins? could be empty causing a php notice. attached patch checks for an empty field in addition to not having ing the correct value to display the notice about the plugin page not being available for all users

Attachments (2)

plugins.php.15292.patch (550 bytes) - added by jorbin 5 years ago.
14010.diff (853 bytes) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (7)

@jorbin5 years ago

comment:1 @nacin5 years ago

  • Milestone changed from Unassigned to 3.0.1
  • Owner set to nacin
  • Status changed from new to accepted

Closed #14012 as a duplicate.

The empty() check is all we need. Also, it looks like the branching here can be approved, by wrapping both the wp_die and add_action in a single empty() check, inside which we check for is_super_admin().

Trivial, but marking for 3.0.1, this came out of the last commit of 3.0 if I remember correctly.

@nacin5 years ago

comment:2 @nacin5 years ago

  • Keywords commit added

comment:3 @westi5 years ago

  • Milestone changed from 3.0.1 to 3.1

I'd leave this out of 3.0.1

We don't usually backport notices fixes to maintenance releases unless they unearth a true bug.

comment:4 @westi5 years ago

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

(In [15323]) Fix notice when visiting the plugins page as a site admin with multisite enabled. Fixes #14010.

comment:5 @nacin5 years ago

  • Milestone changed from Awaiting Triage to 3.1
Note: See TracTickets for help on using tickets.