Okay. Little summary.

Notice: Undefined index: field_date in date_combo_validate() (line 454 in sites/all/modules/contrib/date/date_elements.inc).
Notice: Undefined index: field_date in date_combo_validate() (line 455 in sites/all/modules/contrib/date/date_elements.inc).

And my date fields was empty...

If we look to the latest code we can found this:

  $item = $form_values[$field_name][$langcode][$delta];
  $posted = $form_input[$field_name][$langcode][$delta];

I get this errors on order edit form(drupal commerce).
Date field attached to customer profile.
So actually $item located in
$form_values['commerce_customer_billing']['und']['profiles'][0]['field_date']['und'][0]
instead
$form_values['field_date']['und'][0]

Same to $pasted variable!

To fix this we need to use ['element']['#parents'] and drupal_array_get_nested_value

Attached patch fix problem.

CommentFileSizeAuthor
date_parents.patch614 bytes5n00py
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

5n00py’s picture

Someone can review/commit my patch?

westwesterson’s picture

This patch fixed the problem for me :)

lcampanis’s picture

Fixed for me too :)

I had a field collection with an image upload (enabled alt & title)
And a date field.

5n00py’s picture

Status: Needs review » Reviewed & tested by the community

All people who have same problems(not a lot, but) confirm that patch solve the problem.

cafuego’s picture

Status: Reviewed & tested by the community » Needs review

Tests appear fixed, re-test this patch.

cafuego’s picture

date_parents.patch queued for re-testing.

5n00py’s picture

Status: Needs review » Reviewed & tested by the community

Pass at Sun, 09/29/2013 - 08:17:28

5n00py’s picture

Can this one be committed to 7.x ? W/o this patch my field is broken :(
Patch just use proper api calls instead hardcoded array keys.

cafuego’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-2.x-dev, thanks for the patch!

Status: Fixed » Closed (fixed)

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