Problem/Motivation
Pathauto provides several services, but they cannot be autowired. See core for reference: #3325557: Enable more service autowiring by adding interface aliases to core modules
Steps to reproduce
- Implement a service that injects @pathauto.generator
- Enable autowiring for the new service
Results in the following error message:
Cannot autowire service "[service name]": argument "$pathautoGenerator" of method "[CLASS_NAME]::__construct()" references interface "Drupal\pathauto\PathautoGeneratorInterface" but no such service exists. You should maybe alias this interface to the existing "pathauto.generator" service.
Proposed resolution
Allow pathauto services to be autowired
Remaining tasks
- Write a merge request
- Review
- Commit
User interface changes
None
API changes
Pathauto services can now be autowired
Data model changes
None
Issue fork pathauto-3533941
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
idebr commentedComment #4
berdirProbably could add the alias type manager as well, doesn't need to be an interface, but is probably also not really needed. But we can still o that elsewhere. Changing our own services to autowire can also be done separately.
Merged.