Hello,
Problem/Motivation
I was reviewing the code of the AliasManager.php file and noticed that the __construct method has missed the dependency of AliasRepositoryInterface of $alias_repository.
public function __construct($alias_repository, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache) {
$this->pathAliasRepository = $alias_repository;
$this->languageManager = $language_manager;
$this->whitelist = $whitelist;
$this->cache = $cache;
}
Steps to reproduce
1. Installation of Drupal 9.4.5.
2. Go to the location of the file: /core/modules/path_alias/src/AliasManager.php
Proposed resolution
I have added the AliasRepositoryInterface inside the _construct method.
Comments
Comment #2
rakesh.drupal commentedComment #3
rakesh.drupal commentedKindly review!
Comment #4
cilefen commentedComment #5
hhvardan commented+1 RTBC
Comment #6
alexpottWe missed adding this typehint when we removed the deprecated code in #3092090: Remove legacy Path Alias subsystem, Before that was committed we were triggering a deprecation if something with the wrong interface was being passed in.
Comment #7
alexpottDiscussed with @catch - we agreed that committing this to 10.x was the best strategy. We should have added the typehint when we removed the deprecation but we missed it. A new major is good time to add typehints like this - especially given the prior state of the code.
Committed and pushed 946d271597 to 10.1.x and b44b4550ea to 10.0.x. Thanks!