Problem/Motivation
The widget JS doesn't work correctly when a theme has changed form or form item templates
Most of the JS functions determine the wrapper of the current element by looking for a containing "fieldset" element. But that's not specific enough, since themes are free to change things at will. Bootstrap Barrio, for example, wraps each form element (like the time input and date input separately) in its own fieldset. The widget JS finds this new fieldset and is not in the expected context needed to continue.
Steps to reproduce
Download and enable Bootstrap Barrio; set up a node form with a Smart Date widget; edit a node without using the admin theme.
Change a start date, start time or duration field value; the end value does not change correspondingly.
Proposed resolution
Module JS should only rely on attributes or elements specifically added by the module. In this case, instead of looking for a generic fieldset element, we can look for an element with the ".smartdate--widget" class.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | smart_date-3225159-2-widget_js.patch | 2.72 KB | les lim |
Comments
Comment #2
les limPatch attached.
Comment #4
mandclu commentedThanks for identifying this, and for providing a fix. Merged in these changes, and plan to roll a new release which will include this.