Révision ee46a8ed
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/date/date_elements.inc | ||
---|---|---|
74 | 74 |
// The repeating values will be re-generated when the repeat widget form is validated. |
75 | 75 |
// At this point we can't tell if this form element is going to be hidden by #access, and we're going to |
76 | 76 |
// lose all but the first value by doing this, so store the original values in case we need to replace them later. |
77 |
if (!empty($field['settings']['repeat'])) { |
|
77 |
if (!empty($field['settings']['repeat']) && module_exists('date_repeat_field')) {
|
|
78 | 78 |
if ($delta == 0) { |
79 | 79 |
$form['#after_build'][] = 'date_repeat_after_build'; |
80 | 80 |
$form_state['storage']['repeat_fields'][$field_name] = array_merge($form['#parents'], array($field_name)); |
... | ... | |
474 | 474 |
$form_values = drupal_array_get_nested_value($form_state['values'], $element['#field_parents']); |
475 | 475 |
$form_input = drupal_array_get_nested_value($form_state['input'], $element['#field_parents']); |
476 | 476 |
|
477 |
// Programmatically calling drupal_submit_form() does not always add the date |
|
478 |
// combo to $form_state['input']. |
|
479 |
if (empty($form_input[$field_name]) && !empty($form_values[$field_name])) { |
|
480 |
form_set_value($element, $element['#date_items'], $form_state); |
|
481 |
return; |
|
482 |
} |
|
477 | 483 |
// If the whole field is empty and that's OK, stop now. |
478 | 484 |
if (empty($form_input[$field_name]) && !$element['#required']) { |
479 | 485 |
return; |
... | ... | |
546 | 552 |
return; |
547 | 553 |
} |
548 | 554 |
} |
549 |
// Don't look for further errors if errors are already flagged |
|
550 |
// because otherwise we'll show errors on the nested elements |
|
551 |
// more than once. |
|
552 |
elseif (!form_get_errors()) { |
|
553 |
|
|
555 |
else { |
|
554 | 556 |
$timezone = !empty($item[$tz_field]) ? $item[$tz_field] : $element['#date_timezone']; |
555 | 557 |
$timezone_db = date_get_timezone_db($field['settings']['tz_handling']); |
556 | 558 |
$element[$from_field]['#date_timezone'] = $timezone; |
... | ... | |
625 | 627 |
} |
626 | 628 |
} |
627 | 629 |
} |
628 |
if (!empty($errors)) { |
|
630 |
// Don't show further errors if errors are already flagged |
|
631 |
// because otherwise we'll show errors on the nested elements |
|
632 |
// more than once. |
|
633 |
if (!form_get_errors() && !empty($errors)) { |
|
629 | 634 |
if ($field['cardinality']) { |
630 | 635 |
form_error($element, t('There are errors in @field_name value #@delta:', array('@field_name' => $instance['label'], '@delta' => $delta + 1)) . theme('item_list', array('items' => $errors))); |
631 | 636 |
} |
Formats disponibles : Unified diff
Update date 7.x-2.9 -> 7.x-2.10-rc1