I've identified this problem tracing this bug report in Commerce Fieldgroup Panes module #1364638: All Day and End Date checkboxes are not working when Date field added to Commerce fieldgroup pane, when you embed a date field inside other form elements the "All Day" checkbox doesn't hide hours and minutes properly because the first parent is not always the expected one as it is being retrieved from #array_parents.
Reviewing the documentation of what is the difference between using #parents and #array_parents for getting the correct form elements, I'd say we should use #parents for this case, see http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.... & http://drupal.org/node/279246#comment-2292322
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1380066-all_day_parents_fix-1.patch | 1.1 KB | pcambra |
| date-all_day_parents_fix.patch | 672 bytes | pcambra |
Comments
Comment #1
pcambraSame goes for Show End Date, patch adapted to handle this one too.
Comment #2
Désiré commentedI've tested the patch, and it's works. But, I think it needs tests, so still needs work...
Comment #3
pcambraThis issue fixes what I think is a misuse of form API, I don't think this needs tests "per-se", if the embedding of the date field should get tests, that would go to a completely different issue.
Comment #4
tim.plunkettI verified this is the right fix, so I committed it.
Thanks!
I also agree its not a functional bug that would benefit from tests.
http://drupalcode.org/project/date.git/commitdiff/188d881
Comment #6
vregouby commentedActually I get this issue on a date field with no "end date" nor "all day". I am adding a standard date field on a commerce order with Commerce Fieldgroup Panes, updating the widget to popup calendar and I get the errors:
Notice : Undefined index: time dans date_popup_input_date() (ligne 522 dans /my.site/sites/all/modules/date/date_popup/date_popup.module).
Notice : Undefined index: time dans date_popup_process_time_part() (ligne 419 dans /my.site/sites/all/modules/date/date_popup/date_popup.module).
Notice : Undefined index: time dans date_popup_input_date() (ligne 522 dans /my.site/sites/all/modules/date/date_popup/date_popup.module).
Notice : Undefined index: time dans date_popup_process_time_part() (ligne 419 dans /my.site/sites/all/modules/date/date_popup/date_popup.module).
Is that the same kind of issue ? Is it possible to use the date module with Commerce Fieldgroup Panes ?