Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#27551 closed defect (bug) (fixed)

Edit Image doesn't work on custom header/background screen and in Customizer

Reported by: ocean90's profile ocean90 Owned by: nacin's profile nacin
Milestone: 3.9 Priority: high
Severity: normal Version: 3.9
Component: Customize Keywords: needs-patch
Focuses: javascript Cc:


Steps to reproduce:

  • Go to themes.php?page=custom-header
  • Click "Choose Image" to select an image from media library
  • Select an image and click "Edit Image" link in attachment details

You will notice that nothing happens. Try to select another image now, broken too.

From the JS console:

Uncaught TypeError: Cannot call method 'single' of undefined media-views.js?ver=3.9-beta2-27714-src:4313 media-views.js?ver=3.9-beta2-27714-src:4313 media-views.js?ver=3.9-beta2-27714-src:4094 media-views.js?ver=3.9-beta2-27714-src:5569
Backbone.View backbone.js?ver=1.1.2:1001
wp.Backbone.View.Backbone.View.extend.constructor wp-backbone.js?ver=3.9-beta2-27714-src:349
media.View.wp.Backbone.View.extend.constructor media-views.js?ver=3.9-beta2-27714-src:1398
child backbone.js?ver=1.1.2:1566
child backbone.js?ver=1.1.2:1566 media-views.js?ver=3.9-beta2-27714-src:5132
triggerEvents backbone.js?ver=1.1.2:208
Backbone.Events.trigger backbone.js?ver=1.1.2:148
_.extend._onModelEvent backbone.js?ver=1.1.2:946
triggerEvents backbone.js?ver=1.1.2:209
Backbone.Events.trigger backbone.js?ver=1.1.2:149
media.model.Selection.Attachments.extend.single media-models.js?ver=3.9-beta2-27714-src:1279
triggerEvents backbone.js?ver=1.1.2:208
Backbone.Events.trigger backbone.js?ver=1.1.2:148
_.extend.reset backbone.js?ver=1.1.2:770 media-views.js?ver=3.9-beta2-27714-src:4253 media-views.js?ver=3.9-beta2-27714-src:4190
n.event.dispatch jquery.js?ver=1.11.0:3
r.handle jquery.js?ver=1.11.0:3

Attachments (1)

27551-01.patch (948 bytes) - added by gcorne 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @nacin
10 years ago

Yeah, the link should be hidden for these workflows.

#2 @ocean90
10 years ago

  • Summary changed from Edit Image doesn't work on custom header/background screen to Edit Image doesn't work on custom header/background screen and in Customizer

Same for Customizer.

10 years ago

#3 @gcorne
10 years ago

This is an issue because the image edit state was not one of the states in the custom header frame. 27551-01.patch fixes this issue, which third-party plugins could also hit. We still may want to either add the ImageEdit state to this frame or remove the link for UX reasons, but the patch should keep things from exploding.

#4 @nacin
10 years ago

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

In 27787:

Avoid JS errors when edit image is not available, such as outside of post editing.

props gcorne.
fixes #27551.

Note: See TracTickets for help on using tickets.