Commit 7b237f50 authored by David Suissa's avatar David Suissa
Browse files

Issue #3291148 by DYdave: Fixed broken tests for Drupal 10, due to argument ''...

Issue #3291148 by DYdave: Fixed broken tests for Drupal 10, due to argument '' required in 'ImageFormatter::__construct()' as of 'drupal:10.0.0', see DO-2940031.
parent 50f77777
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\File\FileUrlGeneratorInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@@ -37,12 +38,20 @@ class ImageLinkFormatter extends ImageFormatter implements ContainerFactoryPlugi
   */
  private $entityFieldManager;

  /**
   * The file URL generator.
   *
   * @var \Drupal\Core\File\FileUrlGeneratorInterface
   */
  protected $fileUrlGenerator;

  /**
   * {@inheritdoc}
   */
  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityStorageInterface $image_style_storage, EntityFieldManagerInterface $entity_field_manager) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $current_user, $image_style_storage);
  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityStorageInterface $image_style_storage, EntityFieldManagerInterface $entity_field_manager, FileUrlGeneratorInterface $file_url_generator) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $current_user, $image_style_storage, $file_url_generator);
    $this->entityFieldManager = $entity_field_manager;
    $this->fileUrlGenerator = $file_url_generator;
  }

  /**
@@ -59,7 +68,8 @@ class ImageLinkFormatter extends ImageFormatter implements ContainerFactoryPlugi
      $configuration['third_party_settings'],
      $container->get('current_user'),
      $container->get('entity_type.manager')->getStorage('image_style'),
      $container->get('entity_field.manager')
      $container->get('entity_field.manager'),
      $container->get('file_url_generator')
    );
  }