Allow pathauto services to be autowired

Created on 3 July 2025, 12 days ago

Problem/Motivation

Pathauto provides several services, but they cannot be autowired. See core for reference: 📌 Enable more service autowiring by adding interface aliases to core modules Fixed

Steps to reproduce

  1. Implement a service that injects @pathauto.generator
  2. 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

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

None

API changes

Pathauto services can now be autowired

Data model changes

None

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands idebr

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