- Issue created by @adwivedi008
I was extending this formatter to create a new image formatter and find the issue that this core field formatted is not using dependency injection at
core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
$image_styles = image_style_options(FALSE);
$description_link = Link::fromTextAndUrl(
$this->t('Configure Image Styles'),
Url::fromRoute('entity.image_style.collection')
);
if ($style_id && $style = ImageStyle::load($style_id)) {
if (!empty($dependencies[$style->getConfigDependencyKey()][$style->getConfigDependencyName()])) {
$replacement_id = $this->imageStyleStorage->getReplacementId($style_id);
1. To use dependency injection for using Drupal services.
Active
11.0 🔥