Correctly derive domain alias when URL is provided in a drush command

Created on 29 October 2020, almost 5 years ago
Updated 16 August 2025, about 1 month ago

Problem/Motivation

From discussion on ✨ Conflict resolution for multiple Domain Aliases on same environment Postponed: needs info it would seem the root cause could be that the domain alias is not being derived correctly when it is provided via a drush command.

Steps to reproduce

1. Install domain_alias module
2. Create a domain "www.example.com"
3. Setup these aliases on that domain for the DEV environment in this order:
- dev.example.com
- exampledev.prod.acquia-sites.com
4. Setup these aliases on that domain for the STAGE environment in this order:
- exampletest.prod.acquia-sites.com
- stg.example.com
5. Deploy these changes to DEV and STAGE
6. SSH into DEV and notice the Domain loads to "dev.example.com"
drush php:cli -l https://dev.example.com
>>> echo \Drupal::entityTypeManager()->getStorage("domain")->load("example_com")->get("hostname") . "\n";
dev.example.com
7. SSH into STAGE and notice the Domain loads to "exampletest.prod.acquia-sites.com"
drush php:cli -l https://stg.example.com
>>> echo \Drupal::entityTypeManager()->getStorage("domain")->load("example_com")->get("hostname") . "\n";
exampletest.prod.acquia-sites.com"

The human doing this might expect "stg.example.com" to load because that is the domain passed via the CLI. However, it's not!

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

- Domain Alias

Created by

πŸ‡ΊπŸ‡ΈUnited States josephdpurcell@gmail.com

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.

Production build 0.71.5 2024