Remove File token hook dead code

Created on 14 December 2024, 9 days ago

Problem/Motivation

Follow-up to πŸ“Œ Split File hooks into separate classes Active where I noticed we have the following code in \Drupal\file\Hook\CronHook::__invoke():

    $url_options = ['absolute' => TRUE];
    if (isset($options['langcode'])) {
      $url_options['language'] = $this->languageManager->getLanguage($options['langcode']);
      $langcode = $options['langcode'];
    }
    else {
      $langcode = NULL;
    }

However, $url_options is never read anywhere, which means \Drupal\Core\Language\LanguageManagerInterface::getLanguage() is being called unneccessarily and the LanguageManagerInterface dependency can be removed.

Steps to reproduce

Proposed resolution

Remove the $url_options variable and LanguageManagerInterface dependency.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

file.module

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024