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.

Command icon 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

istankevych created an issue. See original summary.

istankevych’s picture

This patch fixes the Drupal 11 compatibility issue by replacing the deprecated AliasWhitelistInterface with AliasPrefixListInterface in the DomainPathAliasManager class.

Changes made:
- Updated import statement to use AliasPrefixListInterface
- Updated constructor parameter from $whitelist to $prefix_list
- Updated parameter documentation
- Updated parent constructor call

The patch has been tested and successfully resolves the fatal error when enabling the domain_path module on Drupal 11.1.8.

istankevych’s picture

Issue summary: View changes
mably’s picture

This should be resolved by issue #3563256: Refactor DomainPathAliasManager into a decorator with caching, which refactors DomainPathAliasManager into a decorator.

Any feedback will be greatly appreciated.

mably’s picture

Version: 8.x-1.5 » 2.x-dev
Status: Active » Fixed

Drupal 11 compatible 2.0.0-alpha1 version released.

Flagging this issue as "Fixed" for now. Feel free to reopen if necessary.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.