Problem

When Domain module's path prefix feature is enabled (allowing multiple domains to share a single hostname differentiated by a path prefix), the Domain Path widget labels have two issues:

  1. Hostname labels don't distinguish prefixed domains — When alias_title is set to hostname, domains sharing the same hostname but with different prefixes are indistinguishable (both show example.com). The prefix should be appended to produce example.com/fr.
  2. Pathauto widget ignores alias_title settingDomainPathautoWidget::formElement() always uses getPath() for the "Generate automatic URL alias for @domain" checkbox label, ignoring the alias_title config setting that the parent DomainPathWidget respects.

Steps to reproduce

  1. Enable Domain module's path prefix support at /admin/config/domain/settings
  2. Create two domains sharing the same hostname — one without a prefix and one with prefix fr
  3. Set Domain Path's alias_title to hostname at /admin/config/domain_path/settings — both domains show the same hostname with no way to tell them apart
  4. Enable domain_path_pathauto — the checkbox label always shows the URL regardless of the alias_title setting

Fix

  1. Append prefix to hostname labelsDomainPathWidget and DomainPathautoWidget now append the path prefix to the hostname when alias_title === 'hostname' (e.g., example.com/fr).
  2. Pathauto widget respects alias_titleDomainPathautoWidget::formElement() now reads the alias_title setting to choose between domain name, hostname, or URL — consistent with the parent widget.
  3. Update radio button label — The hostname option in DomainPathSettingsForm now reads "The raw hostname (with path prefix if set)".
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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Issue summary: View changes
mably’s picture

Fix

  1. Remove manual prefix appendingDomainPathWidget and DomainPathautoWidget no longer call getPathPrefix() to manually append the prefix after getPath(), since getPath() already includes it.
  2. Append prefix to hostname labels — When alias_title === 'hostname', the prefix is appended to the hostname (e.g., example.com/fr) so prefixed domains sharing the same hostname are distinguishable.
  3. Update radio button label — The hostname option in DomainPathSettingsForm now reads "The raw hostname (with path prefix if set)".
  4. Pathauto widget respects alias_titleDomainPathautoWidget::formElement() now reads the alias_title setting instead of always using getPath(), consistent with the parent DomainPathWidget.
mably’s picture

Issue summary: View changes

  • mably committed 8a4c3313 on 3.x
    task: #3577787 Domain path widget labels missing path prefix when...
mably’s picture

Status: Needs review » Fixed

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.