ISSUE:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "path.alias_manager". Did you mean this: "path_alias.manager"? in Drupal\Component\DependencyInjection\Container->get() (line 156 of core\lib\Drupal\Component\DependencyInjection\Container.php).
Drupal::service('path.alias_manager') (Line: 53)
Solution:
Drupal 9
change path.alias_manager in to path_alias.manager in D9, That's it.
$current_path = \Drupal::service('path.current')->getPath();
$result = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
- Add new comment
- 101 views
Comments
Location
Submitted by Joe (not verified) on Fri, 11/25/2022 - 10:41
Hi,
I'm new to drupal. Where (which file) do I have to change this parameter?
(change path.alias_manager in to path_alias.manager in D9, That's it.)
Thanks in advance
Add new comment