Drupal 11 compatibility: Replace deprecated AliasWhitelistInterface with AliasPrefixListInterface

Created on 16 September 2025, 18 days ago

Problem/Motivation

The domain_path module is not compatible with Drupal 11 due to the deprecation of AliasWhitelistInterface in favor of AliasPrefixListInterface. When enabling the domain_path module on Drupal 11, the site breaks with fatal errors because the module is still using the deprecated interface.

The core issue is that in Drupal 11, the path_alias.manager service constructor changed from using AliasWhitelistInterface to AliasPrefixListInterface, but the domain_path module's DomainPathAliasManager class still references the old interface.

Steps to reproduce

1. Install Drupal 11.1.8
2. Install the domain_path module (8.x-1.5)
3. Enable the domain_path module
4. Clear cache or access the site
5. Site breaks with fatal error: TypeError: Drupal\domain_path\DomainPathAliasManager::__construct(): Argument #1 ($alias_repository) must be of type Drupal\path_alias\AliasRepositoryInterface, string given

Proposed resolution

Update the DomainPathAliasManager class to use the new AliasPrefixListInterface instead of the deprecated `AliasWhitelistInterface`:

1. Change the import statement from use Drupal\path_alias\AliasWhitelistInterface; to use Drupal\path_alias\AliasPrefixListInterface;
2. Update the constructor parameter from AliasWhitelistInterface $whitelist to AliasPrefixListInterface $prefix_list
3. Update the parameter documentation to reflect the new interface
4. Update the parent constructor call to use the new parameter name

This change maintains backward compatibility while ensuring the module works with Drupal 11's updated path alias system.

Remaining tasks

- [ ] Apply the patch to the domain_path module
- [ ] Test the module functionality with Drupal 11
- [ ] Verify that domain-specific path aliases work correctly
- [ ] Test with various domain configurations
- [ ] Update module documentation if needed

User interface changes

No user interface changes. This is a backend compatibility fix that maintains all existing functionality.

API changes

Breaking change: The DomainPathAliasManager::__construct() method signature changes:
- Before: __construct(AliasRepositoryInterface $alias_repository, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache, TimeInterface $time)
- After: __construct(AliasRepositoryInterface $alias_repository, AliasPrefixListInterface $prefix_list, LanguageManagerInterface $language_manager, CacheBackendInterface $cache, TimeInterface $time)

This change is necessary for Drupal 11 compatibility and follows the core API changes.

Data model changes

No data model changes. The fix only updates the service interface usage without affecting any stored data or database schema.

πŸ› Bug report
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States eliasbrat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024