Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#27841 closed defect (bug) (invalid)

Fix Custom Menu save notices when there are no menus created

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

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 11 years ago.

Download all attachments as: .zip

Change History (6)

@nofearinc
11 years ago

#1 follow-up: @nacin
11 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
11 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
11 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
10 years ago

  • Keywords close added; reporter-feedback removed
  • Resolution set to invalid
  • Status changed from new to closed

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

#5 @SergeyBiryukov
10 years ago

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