Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
date_parents.patch | 614 bytes | 5n00py | |
Comments
Comment #1
5n00py CreditAttribution: 5n00py commentedSomeone can review/commit my patch?
Comment #2
westwesterson CreditAttribution: westwesterson commentedThis patch fixed the problem for me :)
Comment #3
lcampanis CreditAttribution: lcampanis commentedFixed for me too :)
I had a field collection with an image upload (enabled alt & title)
And a date field.
Comment #4
5n00py CreditAttribution: 5n00py commentedAll people who have same problems(not a lot, but) confirm that patch solve the problem.
Comment #5
cafuego CreditAttribution: cafuego commentedTests appear fixed, re-test this patch.
Comment #6
cafuego CreditAttribution: cafuego commenteddate_parents.patch queued for re-testing.
Comment #7
5n00py CreditAttribution: 5n00py commentedPass at Sun, 09/29/2013 - 08:17:28
Comment #8
5n00py CreditAttribution: 5n00py commentedCan 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.
Comment #9
cafuego CreditAttribution: cafuego commentedCommitted to 7.x-2.x-dev, thanks for the patch!