Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#28055 closed defect (bug) (fixed)

Twenty Fourteen: undefined index PHP warning when activating the Ephemera widget for first time in the Customizer

Reported by: lancewillett's profile lancewillett Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: good-first-bug has-patch
Focuses: Cc:


To repeat:

  1. Enable latest version of Twenty Fourteen with latest WP trunk (with WP_DEBUG on of course).
  2. Enter Customizer and add the Twenty Fourteen Ephemera widget to the "Content Sidebar" (so you can easily see the error output).

Warning text:

Undefined index: format in /wp-content/themes/twentyfourteen/inc/widgets.php on line 50

Attachments (2)

28055.diff (660 bytes) - added by jartes 10 years ago.
28055.2.diff (629 bytes) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Bundled Theme

#2 @jartes
10 years ago

Here is my proposal. Simply checks if the 'format' key exists. If not, I set the value to 'aside' which is the default value in the widget configuration.

10 years ago

#3 @SergeyBiryukov
10 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.0

We can use the check we already have in Twenty_Fourteen_Ephemera_Widget::form():

#4 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 28248:

Twenty Fourteen: Avoid a PHP notice in Ephemera widget.

props jartes.
fixes #28055.

#5 @lancewillett
10 years ago

Please note when we use "good first bug" keyword. This was intended to be used for WordCamp Zurich contributor day, for a new contributor to learn how to patch a Trac ticket.

Last edited 10 years ago by lancewillett (previous) (diff)

#6 @SergeyBiryukov
10 years ago

Well, the ticket already had a patch from a new contributor, so I thought its purpose was fulfilled. I didn't know it was intended for a specific event, sorry for that.

#7 @jartes
10 years ago

Sorry. I didn't know it was for WordCamp Zurich :(

Note: See TracTickets for help on using tickets.