Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#27841 closed defect (bug) (invalid)

Fix Custom Menu save notices when there are no menus created

Reported by: nofearinc Owned by:
Priority: normal Milestone:
Component: Widgets Version: 3.9
Severity: minor Keywords: has-patch close
Cc: Focuses:

Description

When adding the Custom Menu widget on a clean 3.9 install without custom menus created upfront, two PHP notices are triggered:

PHP Notice: Undefined index: title in /opt/lampp/htdocs/wp39/wp-includes/default-widgets.php on line 1326, referer: http://localhost/wp39/wp-admin/widgets.php
PHP Notice: Undefined index: nav_menu in /opt/lampp/htdocs/wp39/wp-includes/default-widgets.php on line 1327, referer: http://localhost/wp39/wp-admin/widgets.php

Adding an isset() check with default values before populating.

Attachments (1)

27841.patch (671 bytes ) - added by nofearinc 12 years ago.

Download all attachments as: .zip

Change History (6)

@nofearinc
12 years ago

#1 follow-up: @nacin
12 years ago

This doesn't seem to be a regression. Otherwise... related/duplicate of #27878? (At least the solution there.)

#2 in reply to: ↑ 1 @nofearinc
12 years ago

Replying to nacin:

This doesn't seem to be a regression. Otherwise... related/duplicate of #27878? (At least the solution there.)

UX-wise it seems like a good idea adding a "Select" which would solve part of the problem. However the notice was also triggered for the title which is a text input.

#3 @ocean90
12 years ago

  • Keywords reporter-feedback added

Is this still an issue? Can't reproduce this in current trunk.

The other update() methods don't do an isset() check too.

#4 @tyxla
11 years ago

  • Keywords close added; reporter-feedback removed
  • Resolutioninvalid
  • Status newclosed

This issue has been addressed in 28433, related ticket: #22400.

#5 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.