From 324711a2c7d9d26a7ee96885eb2ccb92fae6f41e Mon Sep 17 00:00:00 2001 From: Mark Conroy Date: Tue, 2 Sep 2025 12:42:34 +0100 Subject: [PATCH] Coding standards fix --- localgov_base.theme | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/localgov_base.theme b/localgov_base.theme index 3858176..35f4e27 100644 --- a/localgov_base.theme +++ b/localgov_base.theme @@ -8,6 +8,7 @@ use Drupal\Component\Utility\Crypt; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\media\Entity\Media; use Drupal\node\NodeInterface; use Drupal\views\ViewExecutable; @@ -422,15 +423,15 @@ function localgov_base_preprocess_file_link(&$variables): void { // Load media entity from file. $media_id = $file->_referringItem->getParent()->getParent()->getEntity()->get('mid')->getString(); - $media = \Drupal\media\Entity\Media::load($media_id); + $media = Media::load($media_id); $media_name = $media->get('name')->getString(); if (isset($variables['link']['#title'])) { $document_title = $variables['link']['#title']; if ($media_name && $media_name !== $document_title) { - // If the media name is set and different to the $variables['link']['#title'], - // we will use that instead. + // If the media name is set and different to the + // $variables['link']['#title'], we will use that instead. $document_title = $media_name; }