Quickly though, our integration testing raised a problem. The date
selectors littered throughout the system were now acting screwy. We’re
plugin to get date pickers for the date
fields on forms. This gives two things:
- A three combo box selector for the day, month and year, which can be adjusted to add a time as well, handy for precise selection
- A datepicker button to give you a formatted, JQuery UI date picker.
Although the date picker was working normally, the day selector in the
drop down had all
<options> set to disabled. The options loaded correctly, such that
the currently selected option was selected, but now
as a user you had to use the date picker to select the day.
Weird right? I dug around the widget display code for a bit and couldn’t find much. But then I found this old ticket in the Symfony bug tracker, and all was made clear.
The detail is in the bug but in summary, JQuery changed the way it
accesses DOM properties versus attributes, but sfFormExtra hasn’t been
updated to change this. There are two solutions: one is that you write
your own widgets that inherit from the provided widgets, and then update
the template code there. The second is lazier, but on a given project
you can just update the code yourself in the
sfWidgetFormJqueryDateTime classes. Since we were short of time, I
did the latter, which resolved the issue.
However, I’m intending on going back and writing a widget for it. This will let us better track the differences as JQuery gets updated on these old projects, and will also let us keep any other changes in line.