Problem/Motivation

The service path.alias_manager no longer exists in Drupal 9.2.7, so the following error is triggered:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException : You have requested a non-existent service "path.alias_manager". Did you mean one of these: "path_alias.manager", "hal.link_manager"? dans Drupal\Component\DependencyInjection\Container->get() (ligne 156 de /var/www/web/core/lib/Drupal/Component/DependencyInjection/Container.php).

Proposed resolution

Replace service path.alias_manager by path_alias.manager

Remaining tasks

Patch with the attached .patch file.

Comments

Pauline G created an issue. See original summary.

mmjvb’s picture

Status: Active » Needs review
ewout goosmann’s picture

I ran into the same issue today. The 8.x-1.0-alpha8 version uses the deprecated "path.alias_manager" service, but it's already fixed in the dev version.

yonas.legesse’s picture

StatusFileSize
new2.51 KB
new4.17 KB

The patch fails due to a missing namespace. Post D9, the path manager class has changed to \Drupal\path_alias\AliasManager from \Drupal\Core\Path\AliasManager. I've updated it in the following patch

yonas.legesse’s picture

StatusFileSize
new3.54 KB

Here's the correct patch. Accidentally merged the previous patch with this issue

andriyun’s picture

Status: Needs review » Needs work
+++ b/src/Form/CookiebotForm.php
@@ -264,6 +264,7 @@ class CookiebotForm extends ConfigFormBase {
+      ->set('cookiebot_drupal_culture', $form_state->getValue('cookiebot_drupal_culture'))

This line looks unrelated to this issue

andriyun’s picture

Status: Needs work » Closed (duplicate)