Arguments for DomainPathAliasManager::__construct don't match the parent AliasManager class

Created on 23 May 2025, about 1 month ago

Problem/Motivation

When upgrading to Drupal 11 a PHP fatal error is thrown as the grguments for DomainPathAliasManager::__construct don't match the parent AliasManager class.

PHP Fatal error:  Uncaught TypeError: Drupal\domain_path\DomainPathAliasManager::__construct(): Argument #2 ($whitelist) must be of type Drupal\path_alias\AliasWhitelistInterface, Drupal\path_alias\AliasPrefixList given, called in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and defined in /app/web/modules/contrib/domain_path/src/DomainPathAliasManager.php:30
Stack trace:
#0 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\domain_path\DomainPathAliasManager->__construct(Object(Drupal\path_alias\AliasRepository), Object(Drupal\path_alias\AliasPrefixList), Object(Drupal\Core\Language\LanguageManager), Object(Drupal\Core\Cache\DatabaseBackend), Object(Drupal\Component\Datetime\Time))
#1 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'path_alias.mana...')
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('path_alias.mana...', 1)
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'path_alias.path...')
#5 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('path_alias.path...', 1)
#6 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#7 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'path_processor_...')
#8 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('path_processor_...', 1)
#9 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#10 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'domain.route_pr...')
#11 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('domain.route_pr...', 1)
#12 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#13 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(445): Drupal\Component\DependencyInjection\Container->createService(Array, 'private__qoryc3...')
#14 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#15 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'url_generator')
#16 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('url_generator', 1)
#17 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#18 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'twig.extension')
#19 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get('twig.extension', 1)
#20 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#21 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'twig')
#22 /app/web/core/lib/Drupal.php(197): Drupal\Component\DependencyInjection\Container->get('twig')
#23 /app/web/core/includes/common.inc(423): Drupal::service('twig')
#24 /app/web/core/includes/utility.inc(41): drupal_flush_all_caches(Object(Drupal\Core\DrupalKernel))
#25 /app/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(65): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
#26 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild(Array)
#27 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#28 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#29 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#30 /app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#31 /app/vendor/symfony/console/Command/Command.php(279): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /app/vendor/symfony/console/Application.php(1094): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /app/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 /app/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 /app/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 /app/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 /app/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run(Array)
#38 /app/bin/drush.php(119): include('/app/vendor/dru...')
#39 {main}
  thrown in /app/web/modules/contrib/domain_path/src/DomainPathAliasManager.php on line 30

Steps to reproduce

Install the latest dev version of Domain Path with Drupal 11.

Proposed resolution

The call to the constructor is not needed as it simple calls the parent constructor. Deleting the constructor from the DomainPathAliasManager class fixes the issue.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom stephen-cox

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