WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#37196 new defect (bug)

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

Reported by: argonius Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch needs-testing reporter-feedback
Focuses: administration Cc:
PR Number:

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 3 years ago.
Patch
37196.2.diff (2.0 KB) - added by michalzuber 3 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 (5)

@argonius
3 years ago

Patch

#1 @argonius
3 years ago

  • Keywords has-patch needs-testing added

@michalzuber
3 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
3 years ago

  • Focuses administration added
  • Keywords dev-feedback added

#3 @ocean90
3 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.

Note: See TracTickets for help on using tickets.