Skip to content
Snippets Groups Projects
Commit 67baff4a authored by Yutong Li's avatar Yutong Li Committed by Yas Naoi
Browse files

Issue #3223696 by yutong.li, yas: Fix calling ImageFormatter::__construct()...

Issue #3223696 by yutong.li, yas: Fix calling ImageFormatter::__construct() without the $file_url_generator
parent ef3c33ca
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\File\FileUrlGeneratorInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -44,6 +45,13 @@ class CloudImageFormatter extends ImageFormatter {
*/
protected $entityTypeManager;
/**
* The file URL generator.
*
* @var \Drupal\Core\File\FileUrlGeneratorInterface
*/
protected $fileUrlGenerator;
/**
* Constructs an CloudImageFormatter object.
*
......@@ -69,11 +77,14 @@ class CloudImageFormatter extends ImageFormatter {
* The module handler service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The Entity type manager.
* @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator
* The file URL generator.
*/
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, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_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, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_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->moduleHandler = $module_handler;
$this->entityTypeManager = $entity_type_manager;
$this->fileUrlGenerator = $file_url_generator;
}
/**
......@@ -91,7 +102,8 @@ class CloudImageFormatter extends ImageFormatter {
$container->get('current_user'),
$container->get('entity_type.manager')->getStorage('image_style'),
$container->get('module_handler'),
$container->get('entity_type.manager')
$container->get('entity_type.manager'),
$container->get('file_url_generator')
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment