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.

Comments

pcambra’s picture

Title: "All Day" flag doesn't hide elements when nested » "All Day" & "Show End Date" flags don't hide elements when nested
StatusFileSize
new1.1 KB

Same goes for Show End Date, patch adapted to handle this one too.

Désiré’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I've tested the patch, and it's works. But, I think it needs tests, so still needs work...

pcambra’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

This 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.

tim.plunkett’s picture

Status: Needs review » Fixed

I 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

vregouby’s picture

Actually 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 ?