Skip to content
Snippets Groups Projects
Verified Commit 56e3f8e0 authored by quietone's avatar quietone
Browse files

Issue #3493958 by jquijano, kim.pepper, dcam, adwivedi008: Remove File token hook dead code

parent 622e3cc1
No related branches found
No related tags found
4 merge requests!5423Draft: Resolve #3329907 "Test2",!3478Issue #3337882: Deleted menus are not removed from content type config,!579Issue #2230909: Simple decimals fail to pass validation,!213Issue #2906496: Give Media a menu item under Content
Pipeline #464244 passed with warnings
Pipeline: drupal

#464255

    Pipeline: drupal

    #464249

      Pipeline: drupal

      #464246

        ......@@ -7,7 +7,6 @@
        use Drupal\Core\Datetime\DateFormatterInterface;
        use Drupal\Core\Entity\EntityTypeManagerInterface;
        use Drupal\Core\Hook\Attribute\Hook;
        use Drupal\Core\Language\LanguageManagerInterface;
        use Drupal\Core\Render\BubbleableMetadata;
        use Drupal\Core\StringTranslation\ByteSizeMarkup;
        use Drupal\Core\StringTranslation\StringTranslationTrait;
        ......@@ -22,7 +21,6 @@ class TokenHooks {
        public function __construct(
        private readonly Token $token,
        private readonly LanguageManagerInterface $languageManager,
        private readonly DateFormatterInterface $dateFormatter,
        private readonly EntityTypeManagerInterface $entityTypeManager,
        ) {}
        ......@@ -32,14 +30,7 @@ public function __construct(
        */
        #[Hook('tokens')]
        public function tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata): array {
        $url_options = ['absolute' => TRUE];
        if (isset($options['langcode'])) {
        $url_options['language'] = $this->languageManager->getLanguage($options['langcode']);
        $langcode = $options['langcode'];
        }
        else {
        $langcode = NULL;
        }
        $langcode = $options['langcode'] ?? NULL;
        $replacements = [];
        if ($type == 'file' && !empty($data['file'])) {
        $dateFormatStorage = $this->entityTypeManager->getStorage('date_format');
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment