Issue #2172241 by swentel, webflo | ivanjaros: Fixed Files and image widgets completely broken.
parent
f0337421a4
commit
e9bb4a20e4
|
@ -218,7 +218,7 @@ class ImageWidget extends FileWidget {
|
||||||
'#element_validate' => $element['#title_field_required'] == 1 ? array(array(get_called_class(), 'validateRequiredFields')) : array(),
|
'#element_validate' => $element['#title_field_required'] == 1 ? array(array(get_called_class(), 'validateRequiredFields')) : array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
return $element;
|
return parent::process($element, $form_state, $form);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -258,6 +258,14 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
||||||
$edit['files[' . $field_name . '_1][]'] = drupal_realpath($test_image->uri);
|
$edit['files[' . $field_name . '_1][]'] = drupal_realpath($test_image->uri);
|
||||||
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
|
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
|
||||||
$this->assertText(format_string('Article @title has been updated.', array('@title' => $node->getTitle())));
|
$this->assertText(format_string('Article @title has been updated.', array('@title' => $node->getTitle())));
|
||||||
|
|
||||||
|
// Assert ImageWidget::process() calls FieldWidget::process().
|
||||||
|
$this->drupalGet('node/' . $node->id() . '/edit');
|
||||||
|
$edit = array();
|
||||||
|
$edit['files[' . $field_name . '_2][]'] = drupal_realpath($test_image->uri);
|
||||||
|
$this->drupalPostAjaxForm(NULL, $edit, $field_name . '_2_upload_button');
|
||||||
|
$this->assertNoRaw('<input multiple type="file" id="edit-' . strtr($field_name, '_', '-') . '-2-upload" name="files[' . $field_name . '_2][]" size="22" class="form-file">');
|
||||||
|
$this->assertRaw('<input multiple type="file" id="edit-' . strtr($field_name, '_', '-') . '-3-upload" name="files[' . $field_name . '_3][]" size="22" class="form-file">');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue