- Issue created by @jaimeah
1. Install and enable the [Domain](
https://www.drupal.org/project/domain →
) and [Domain Microsite](
https://www.drupal.org/project/domain_microsite →
) modules.
2. Create a base domain (e.g. `cities.org`) and one or more microsites that:
- Have `is_domain_microsite` = 1
- Define a `base_path` like `/city/boston`
- Set `parent_domain_id` to the main domain
3. Use the `domain_config_pages` context plugin to create domain-aware configuration pages.
4. Navigate to the config page under a microsite (e.g., `/city/boston/admin/content/microsite-metadata?config_pages=3`)
5. Observe that:
- The links generated by `getLinks()` are incorrect
- Microsite links contain duplicated paths or invalid hostnames
- The base domain link may also be broken due to misapplied base paths
- Add logic to detect if a domain is a microsite using `is_domain_microsite`
- If so, load the parent domain using `parent_domain_id` and use its hostname and scheme
- Prepend the microsite’s own `base_path` to the cleaned current route + query
- Strip the current microsite’s `base_path` from the active route to avoid duplication
- Refactor `getLinks()` to delegate URL construction to a helper method
Test Patch
- None, except that generated config context links will now be correct across domains and microsites.
- None. This change is internal to the plugin class.
- None.
Needs review
1.0
Code