Commit ca833681 authored by Dries's avatar Dries

- Patch #627204 by yched: removed unnecessary prefix on field 'add more' element.

parent e54794cd
......@@ -17,7 +17,7 @@ function field_default_extract_form_values($obj_type, $object, $field, $instance
if (isset($form_state['values'][$field_name][$langcode])) {
$items = $form_state['values'][$field_name][$langcode];
// Remove the 'value' of the 'add more' button.
unset($items[$field_name . '_add_more']);
unset($items['add_more']);
}
}
......
......@@ -183,7 +183,7 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form,
// Add 'add more' button, if not working with a programmed form.
if ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED && empty($form_state['programmed'])) {
$form_element[$field_name . '_add_more'] = array(
$form_element['add_more'] = array(
'#type' => 'submit',
'#name' => $field_name . '_add_more',
'#value' => t('Add another item'),
......@@ -236,7 +236,7 @@ function theme_field_multiple_value_form($variables) {
// preview or failed validation)
$items = array();
foreach (element_children($element) as $key) {
if ($key === $element['#field_name'] . '_add_more') {
if ($key === 'add_more') {
$add_more_button = &$element[$key];
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment