diff --git a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php index 944e102..3570c35 100644 --- a/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php +++ b/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php @@ -47,7 +47,7 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['third_party_settings'], $container->get('element_info')); + return new static($plugin_id, $plugin_definition,$configuration['field_definition'], $configuration['settings'], $configuration['third_party_settings'], $container->get('element_info')); } /** diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php index 489c60e..8b69c4a 100644 --- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php +++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php @@ -38,7 +38,22 @@ class ImageWidget extends FileWidget { protected $imageFactory; /** - * {@inheritdoc} + * Constructs an ImageWidget object. + * + * @param array $plugin_id + * The plugin_id for the widget. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition + * The definition of the field to which the widget is associated. + * @param array $settings + * The widget settings. + * @param array $third_party_settings + * Any third party settings. + * @param \Drupal\Core\Render\ElementInfoManagerInterface $element_info + * The element info manager. + * @param \Drupal\Core\Image\ImageFactory $image_factory + * The image factory service. */ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, ElementInfoManagerInterface $element_info, ImageFactory $image_factory) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings, $element_info); diff --git a/core/modules/image/src/Tests/ImageFieldWidgetTest.php b/core/modules/image/src/Tests/ImageFieldWidgetTest.php index 252f4f7..0f027ab 100644 --- a/core/modules/image/src/Tests/ImageFieldWidgetTest.php +++ b/core/modules/image/src/Tests/ImageFieldWidgetTest.php @@ -39,13 +39,13 @@ public function testWidgetElement() { // Try adding to the field config an unsupported extension, should not // appear in the allowed types. $field_config = FieldConfig::loadByName('node', 'article', $field_name); - $field_config ->setSetting('file_extensions', 'png gif jpg jpeg tiff')->save(); + $field_config->setSetting('file_extensions', 'png gif jpg jpeg tiff')->save(); $this->drupalGet('node/add/article'); $this->assertText('Allowed types: png gif jpg jpeg.'); // Add a supported extension and remove some supported ones, we should see // the intersect of those entered in field config with those supported. - $field_config ->setSetting('file_extensions', 'png jpe tiff')->save(); + $field_config->setSetting('file_extensions', 'png jpe tiff')->save(); $this->drupalGet('node/add/article'); $this->assertText('Allowed types: png jpe.'); }