Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41979 closed defect (bug) (fixed)

Caption changes don't cause Gallery widget to refresh in Customizer preview

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: needs-patch
Focuses: Cc:

Description

The Gallery widget (#41914) allows for captions to be supplied for images via the media modal. Whereas the list of attachment ids are part of the widget instance data, the captions are not. Therefore when just changing a caption then no change will be reflected in the Customizer preview since no change was made to the Customizer setting.

This problem was first encountered in the Image widget (#39993) and the solution there was to put the caption into the instance data itself, and disable the auto-saving of the attachment changes back (see also #40403). For the code that was removed from the Image widget which could be useful for the Gallery widget here, see https://github.com/xwp/wp-core-media-widgets/commit/ddd59e2

Reported by @rabmalin in https://core.trac.wordpress.org/ticket/41914#comment:10

Change History (1)

#1 @westonruter
7 years ago

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

In 41872:

Widgets: Update preview for Gallery widget when one of its attachments is modified in the media modal, outside the customized state.

  • Ensure that changes to captions are shown in preview when modified in media modal.
  • Also keep wp.customize.widgetsPreview.renderedWidgets updated when widgets are added or removed.

See #41914, #37887, #40403.
Fixes #41979.

Note: See TracTickets for help on using tickets.