Skip to content
Snippets Groups Projects

Issue #3490397: Inject the file_system service in the theme registry service.

Open Bhanu D requested to merge issue/drupal-3490397:3490397-inject-the-filesystem into 11.x
1 file
+ 8
1
Compare changes
  • Side-by-side
  • Inline
@@ -9,6 +9,7 @@
@@ -9,6 +9,7 @@
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\Extension\ThemeHandlerInterface;
 
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Update\UpdateKernel;
use Drupal\Core\Update\UpdateKernel;
use Drupal\Core\Utility\ThemeRegistry;
use Drupal\Core\Utility\ThemeRegistry;
@@ -205,10 +206,12 @@ class Registry implements DestructableInterface {
@@ -205,10 +206,12 @@ class Registry implements DestructableInterface {
* The kernel.
* The kernel.
* @param string $theme_name
* @param string $theme_name
* (optional) The name of the theme for which to construct the registry.
* (optional) The name of the theme for which to construct the registry.
 
* @param \Drupal\Core\File\FileSystemInterface $fileSystem
 
* The file system service.
* @param array<string, true> $preprocess_for_suggestions
* @param array<string, true> $preprocess_for_suggestions
* (optional) Grouped preprocess functions from modules.
* (optional) Grouped preprocess functions from modules.
*/
*/
public function __construct($root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, CacheBackendInterface $runtime_cache, ModuleExtensionList $module_list, protected HttpKernelInterface $kernel, $theme_name = NULL, array $preprocess_for_suggestions = []) {
public function __construct($root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, CacheBackendInterface $runtime_cache, ModuleExtensionList $module_list, protected HttpKernelInterface $kernel, $theme_name = NULL, protected ?FileSystemInterface $fileSystem = NULL, array $preprocess_for_suggestions = []) {
$this->root = $root;
$this->root = $root;
$this->cache = $cache;
$this->cache = $cache;
$this->lock = $lock;
$this->lock = $lock;
@@ -219,6 +222,10 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte
@@ -219,6 +222,10 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte
$this->moduleList = $module_list;
$this->moduleList = $module_list;
$this->themeName = $theme_name;
$this->themeName = $theme_name;
$this->preprocessForSuggestions = $preprocess_for_suggestions;
$this->preprocessForSuggestions = $preprocess_for_suggestions;
 
if (!$fileSystem instanceof FileSystemInterface) {
 
@trigger_error('Calling ' . __METHOD__ . ' without the $fileSystem argument is deprecated in drupal:11.2.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3490392', E_USER_DEPRECATED);
 
$this->fileSystem = \Drupal::service('file_system');
 
}
}
}
/**
/**
Loading