Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#23181 closed defect (bug) (fixed)

Clear Notice from reset_header_image() method in Custom_Image_Header class

Reported by: wpsmith Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Customize Version:
Severity: normal Keywords: has-patch dev-feedback
Cc: Focuses:

Description

If you take the following steps you will receive a notice for default_data.

  1. Custom header is enabled with a default header image (with no other header images uploaded).
  2. The user clicks Remove Header Image.
  3. The user clicks Restore Original Header Image.

Attachments (2)

23181.patch​ (449 bytes ) - added by wpsmith 14 years ago.
23181.2.patch​ (487 bytes ) - added by SergeyBiryukov 14 years ago.

Download all attachments as: .zip

Change History (8)

@wpsmith
14 years ago

#1 @obenland
14 years ago

I could not recreate it in latest trunk with the steps outlined above.

#2 @wpsmith
14 years ago

If you add the following to TwentyTwelve, it produces the same error.

add_theme_support(
	'custom-header', 
	array(
		'default-image'       => 'http://domain.com/wp-content/themes/twentytwelve/images/header.png', //Ensure image is there
		'header-text'         => '',
		'default-text-color'  => 'blank',
		'width'               => 350,
		'height'              => 100,
		'random-default'      => false,
	)
);

Here's a screencast:
​http://screencast.com/t/T0fTxyCZbH8G

Please note while the video demonstrates it with a Genesis Child theme image, this was tested in both Genesis, TwentyEleven, and TwentyTwelve.

#3 @wpsmith
14 years ago

  • Component General → Administration
  • Keywords has-patch dev-feedback needs-testing added

#4 @SergeyBiryukov
14 years ago

  • Component Administration → Appearance
  • Keywords needs-testing removed
  • Milestone Awaiting Review → 3.6

Confirmed with the code from comment:2.

23181.2.patch​ is an alternative patch.

#5 @kovshenin
14 years ago

  • Cc kovshenin added

23181.patch​ can potentially leave old header image data in the header_image_data theme mod. If we're checking with !empty perhaps we should remove_theme_mod otherwise. 23181.2.patch looks reasonable, since it overwrites the previous value with an empty object.

#6 @SergeyBiryukov
14 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 23337:

Define the variable before using it. fixes #23181.

Note: See TracTickets for help on using tickets.