Commit 49b1c1d7 authored by alexpott's avatar alexpott

Issue #2376899 by Gábor Hojtsy: ImageFieldTestBase::createImageField() takes a...

Issue #2376899 by Gábor Hojtsy: ImageFieldTestBase::createImageField() takes a description in field settings errorneously
parent feaabe2b
......@@ -178,7 +178,6 @@ function testImageFieldSettings() {
'max_resolution' => '100x100',
'min_resolution' => '10x10',
'title_field' => 1,
'description' => '[site:name]_description',
);
$widget_settings = array(
'preview_image_style' => 'medium',
......
......@@ -61,15 +61,15 @@ protected function setUp() {
/**
* Create a new image field.
*
* @param $name
* @param string $name
* The name of the new field (all lowercase), exclude the "field_" prefix.
* @param $type_name
* @param string $type_name
* The node type that this field will be added to.
* @param $storage_settings
* @param array $storage_settings
* A list of field storage settings that will be added to the defaults.
* @param $field_settings
* @param array $field_settings
* A list of instance settings that will be added to the instance defaults.
* @param $widget_settings
* @param array $widget_settings
* A list of widget settings that will be added to the widget defaults.
*/
function createImageField($name, $type_name, $storage_settings = array(), $field_settings = array(), $widget_settings = array()) {
......@@ -81,15 +81,12 @@ function createImageField($name, $type_name, $storage_settings = array(), $field
'cardinality' => !empty($storage_settings['cardinality']) ? $storage_settings['cardinality'] : 1,
))->save();
$description = !empty($field_settings['description']) ? $field_settings['description'] : '';
unset($field_settings['description']);
$field_config = entity_create('field_config', array(
'field_name' => $name,
'label' => $name,
'entity_type' => 'node',
'bundle' => $type_name,
'required' => !empty($field_settings['required']),
'description' => $description,
'settings' => $field_settings,
));
$field_config->save();
......
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