WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#27291 closed defect (bug) (fixed)

Widget Customizer is incompatible with Twenty Fourteen Ephemera Widget

Reported by: celloexpressions Owned by: ocean90
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

Filing this as a widget customizer issue, since it should work with all existing widgets in theory. We could also fix this from the theme's side, though.

A few issues here. I'm guessing some might be known:

  • Adding a Twenty Fourteen Ephemera widget through the widget customizer results in an error in the preview: Undefined index: format in wp-content\themes\twentyfourteen\inc\widgets.php on line 74
  • Changing the format fixes the preview, but causes the widget controls to be replaced with: Notice: Undefined index: widget_twentyfourteen_ephemera-13 in wp-includes\class-wp-customize-widgets.php on line 1045
  • I saw issues with MediaElement.js not being loaded when adding one with the post format set to audio or video at one point, although it doesn't appear to still be an issue.

Attachments (2)

27291.diff (1.8 KB) - added by westonruter 8 years ago.
Ensure customizer is activated in update_widget ajax requests so that newly-added widgets will be recognized; fix positioning of Add Widget button when a widget area has many widgets in it (ensure it is always at the end)
27291.2.diff (1.8 KB) - added by westonruter 8 years ago.
Refreshed patch by resolving conflicts introduced by #27298. Commits (also rebased onto master) have also been pushed up to a branch on our GitHub clone of develop.git.wordpress.org: https://github.com/x-team/wordpress-develop/compare/trac-27291

Download all attachments as: .zip

Change History (7)

@westonruter
8 years ago

Ensure customizer is activated in update_widget ajax requests so that newly-added widgets will be recognized; fix positioning of Add Widget button when a widget area has many widgets in it (ensure it is always at the end)

#1 @westonruter
8 years ago

  • Keywords has-patch added

The issue was not limited to the Ephemera widget. I was able to reproduce the "Undefined index: widget_{widget_id}" issue by adding other widgets as well. The attached patch fixes the problem by ensuring that the update_widget Ajax request will boot up the customizer so that the necessary filters will be put in place to register newly-added widgets.

#2 @ocean90
8 years ago

  • Milestone changed from Awaiting Review to 3.9

@westonruter
8 years ago

Refreshed patch by resolving conflicts introduced by #27298. Commits (also rebased onto master) have also been pushed up to a branch on our GitHub clone of develop.git.wordpress.org: https://github.com/x-team/wordpress-develop/compare/trac-27291

#3 @westonruter
8 years ago

#27338 was marked as a duplicate.

This ticket was mentioned in IRC in #wordpress-dev by ocean90. View the logs.


8 years ago

#5 @ocean90
8 years ago

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

In 27524:

Widget Customizer: Use ?wp_customize=on.

Let _wp_customize_include() handle customizer initialisation.
Sets also the priority for the Add Widget and Reorder buttons and removes debug cruft.

props westonruter.
fixes #27291.

Note: See TracTickets for help on using tickets.