Opened 11 years ago
Closed 11 years ago
#27390 closed enhancement (fixed)
Widget Customizer: Introduce customizer processing state
Reported by: | westonruter | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | ui, javascript | Cc: |
Description
When a widget is updated in the customizer, it submits the widget form via Ajax to pass the fields through the widget's update callback to validate the instance; this Ajax response supplies the value to then be set in the customizer's setting. Thus unlike other setting updates, the updating of a widget's setting is an asynchronous process and the Customizer needs to introduce a method for preventing a race condition when saving such settings which require server-side validation/processing to obtain the setting value to submit.
Originally reported on #27112:
I also saw what I believe to be an unrelated issue: if I make a change to a widget, say its title, leaving focus in the input and then immediately click "Save & Publish" the setting does not get saved, even though I can see it in the preview. If I first click out of the input (blur) and then click "Save & Publish", the setting gets updated as expected. It sticks. I'll do more investigation.
Introduce customizer 'processing' state. Prevent a race condition when saving settings which require server-side validation/processing to obtain the setting value to submit. Patch also pushed to GitHub: https://github.com/x-team/wordpress-develop/compare/trac-27390?w=1