Make WordPress Core

Opened 9 years ago

Closed 5 years ago

#37196 closed defect (bug) (wontfix)

Notice: Undefined offset: 0 in wp-admin/menu-header.php

Reported by: argonius's profile argonius Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch needs-testing reporter-feedback
Focuses: administration Cc:

Description

Sometimes when deactivating a plugin, this notice appears.
Notice Undefined offset: 0
wp-admin/menu-header.php:218

_wp_menu_output()

wp-admin/menu-header.php:255

Attachments (2)

menu-header-37196.diff (716 bytes) - added by argonius 9 years ago.
Patch
37196.2.diff (2.0 KB) - added by michalzuber 9 years ago.
Skip menu item if no title (fallback use page_title), avoid empty anchor. Also as fallback check page_title for submenu item, instead use title from parent menu item.

Download all attachments as: .zip

Change History (6)

@argonius
9 years ago

Patch

#1 @argonius
9 years ago

  • Keywords has-patch needs-testing added

@michalzuber
9 years ago

Skip menu item if no title (fallback use page_title), avoid empty anchor. Also as fallback check page_title for submenu item, instead use title from parent menu item.

#2 @michalzuber
9 years ago

  • Focuses administration added
  • Keywords dev-feedback added

#3 @ocean90
9 years ago

  • Component changed from Menus to General
  • Keywords reporter-feedback added; dev-feedback removed
  • Version trunk deleted

Hello @argonius, welcome to our Trac!

Thanks for your report, can you provide some steps to reproduce the issue? Which plugins are causing the notice?

Also thanks for the patches, both need some adjustments as per the PHP Coding Standards.

#4 @desrosj
5 years ago

  • Component changed from General to Administration
  • Resolution set to wontfix
  • Status changed from new to closed

Since there has been no reporter feedback and I cannot find any additional reports, I am going to close this out.

Looking at the code, the 0 index of this array is the sub menu item title. I can't think of a good use case for having a menu item with no title. If anything, this notice is a good indicator that something is not working correctly.

If you are still able to reproduce and something different is going on, please feel free to reopen with more details.

Note: See TracTickets for help on using tickets.