Commit e9bb4a20 authored by Dries's avatar Dries

Issue #2172241 by swentel, webflo | ivanjaros: Fixed Files and image widgets completely broken.

parent f0337421
...@@ -218,7 +218,7 @@ public static function process($element, &$form_state, $form) { ...@@ -218,7 +218,7 @@ public static function process($element, &$form_state, $form) {
'#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 @@ function testImageFieldSettings() { ...@@ -258,6 +258,14 @@ function testImageFieldSettings() {
$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">');
} }
/** /**
......
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