Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 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:

Description

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 11 years ago.
28055.2.diff (629 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to Bundled Theme

#2 @jartes
11 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.

@jartes
11 years ago

#3 @SergeyBiryukov
11 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():
tags/3.9/src/wp-content/themes/twentyfourteen/inc/widgets.php#L253

#4 @SergeyBiryukov
11 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
11 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 11 years ago by lancewillett (previous) (diff)

#6 @SergeyBiryukov
11 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
11 years ago

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

Note: See TracTickets for help on using tickets.