diff --git a/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php b/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php index 200b5aa..58d7b33 100644 --- a/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php +++ b/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php @@ -38,7 +38,13 @@ class SvgImageUrlFormatter extends ImageUrlFormatter { * {@inheritdoc} */ public function __construct($pluginId, $pluginDefinition, FieldDefinitionInterface $fieldDefinition, array $settings, $label, $viewMode, array $thirdPartySettings, EntityStorageInterface $ImageStyleStorage, AccountInterface $currentUser, FileUrlGeneratorInterface $fileUrlGenerator) { - parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $label, $viewMode, $thirdPartySettings, $ImageStyleStorage, $currentUser); + // The constructor is swapped in 9.4.x vs 9.5+. + if (version_compare($version, '9.5', '>=')) { + parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $label, $viewMode, $thirdPartySettings, $ImageStyleStorage, $currentUser); + } + else { + parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $label, $viewMode, $thirdPartySettings, $currentUser, $ImageStyleStorage); + } $this->fileUrlGenerator = $fileUrlGenerator; }