WordPress.org

Make WordPress Core

#23181 closed defect (bug) (fixed)

Clear Notice from reset_header_image() method in Custom_Image_Header class

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

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 15 months ago.
23181.2.patch (487 bytes) - added by SergeyBiryukov 15 months ago.

Download all attachments as: .zip

Change History (8)

wpsmith15 months ago

comment:1 obenland15 months ago

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

comment:2 wpsmith15 months 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.

comment:3 wpsmith15 months ago

  • Component changed from General to Administration
  • Keywords has-patch dev-feedback needs-testing added

SergeyBiryukov15 months ago

comment:4 SergeyBiryukov15 months ago

  • Component changed from Administration to Appearance
  • Keywords needs-testing removed
  • Milestone changed from Awaiting Review to 3.6

Confirmed with the code from comment:2.

23181.2.patch is an alternative patch.

comment:5 kovshenin15 months 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.

comment:6 SergeyBiryukov15 months ago

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

In 23337:

Define the variable before using it. fixes #23181.

Note: See TracTickets for help on using tickets.