Install
Works with Drupal: ^10.2 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
454.26 KB
MD5: c2e25b5995e69a5495796eb468ff6e70
SHA-1: 1be75e285494d237ada01a5f829b77b34ebc716b
SHA-256: 64c681552f192ae401366bcbd02c4a72d3dd16566450f058a746f3ef3148c6d7
Download zip
751.9 KB
MD5: bb9cbe3423b0383d030e1d10bb62adb0
SHA-1: c354f0a77ebc70fc2251cdb2e32dbacf8dd66fba
SHA-256: 8bdcfaea8cc66919eb14adb75ad21e419b91acf7cf90fc7ff9132a10d2833d19
Release notes
Domain 3.1.0-alpha1 is a substantive cleanup release that clarifies the public/internal API boundary, finishes a refactor of the domain negotiation pipeline, and lands a coordinated cluster of domain_alias pattern-matching fixes that had been silently corrupting alias resolution in some multi-pattern setups. Most existing sites get strict behavior-preserving changes plus deprecation warnings on legacy entry points; the alias-pattern fixes ship one user-visible ordering change worth reviewing (see #3588155 below).
Contributors (1)
Changelog
Issues: 11 issues resolved.
Changes since 3.0.0 (compare):
Bug
- fix: #3587744 domain_config: Make
DomainConfigOverrideEditable::save()write a sparse, cast-aware diff against base. Previouslysave()wrote$moduleOverridesverbatim — fine for per-keyset()callers (ConfigFormBase) butsetData()callers (ConfigEntityStorage::doSave(), drush, custom code) had their changes silently dropped. Save now derives the override row as a sparse, schema-cast diff against base on every path, so both flows produce the same result and keys reset to base correctly drop from the override. Documents the known coreNestedArray::mergeDeepArraylimitation around sequence shrinks, with three working alternatives. - fix: #3588155 DomainAliasStorage pattern matching:
sort()comparator never returns -1, and port-pattern priority is wrong. Behavior change worth reviewing: the alias-pattern matcher now respects specificity. A bare-hostname alias (e.g.staging.example.com) wins over a:*alias (e.g.staging.example.com:*) on the same hostname when no explicit port is given, and an explicit-port alias (e.g.staging.example.com:8080) wins over:*on the same port. Sites that relied on the previous buggy:*-first ordering should review their alias config — the new ordering is what the surrounding documentation and docblocks already claim. - fix: #3588168
DomainAliasStorage::buildPatterns()generates an incomplete wildcard pattern set. The pattern enumerator was missing partial-replacement combinations when a hostname contained multiple wildcard segments, causing some valid alias matches to be missed. Now enumerates the complete pattern set. - fix: #3588169 DomainAlias pattern validator should not count the port wildcard against the host wildcard limit. The validator no longer counts the port wildcard
:*against the host-wildcard limit. Patterns combining a single host wildcard with a port suffix (e.g.example.*:*,*.example.com:8080) now save successfully — these were always documented as supported and handled by the matching pipeline; only the validator blocked them. Patterns containing?are now flagged with a deprecation notice on save —?was a single-character wildcard in Domain 6.x/7.x but has not been honored as a wildcard since the 8.x-1.x port; it will be removed from the alias pattern allowlist entirely indomain:4.0.0. Sites with?patterns should clean them up before upgrading to 4.0.0. - fix: #3588175
DomainAliasPatternResolver::replaceWildcards()positional substitution silently corrupts cross-pattern alias resolution when source and target patterns differ. The wildcard substituter assumed source and target patterns had matching wildcard counts in matching positions. When they didn't (legitimate use case for cross-environment alias rewriting), it silently produced incorrect URLs. Mismatches are now rejected with a clear error.
Feature
- feat: #3588176 Allow up to two host wildcards in alias patterns. The validator's host-wildcard cap is raised from 1 to 2, enabling patterns like
*.*.example.comfor sites that genuinely need two wildcard segments. The cap stays in place to keep the matching engine bounded — if you need three or more, file an issue.
Task
- docs: #3588137 Cross-link domain_config_ui docs to domain_menu_extras submodule. Discoverability follow-up: per-domain config can affect rendering that depends on language-keyed plugin definitions cached by core (
LocalTaskManager,LocalActionManager,ContextualLinkManager); without a cache key that varies by domain, the first domain to warm the cache wins and others render stale tabs/actions. The fix lives in thedomain_menu_extrassubmodule ofdomain_extras; readers ofdomain_config_uidocs now have a signpost pointing there. - task: #3583423 Introduce
DomainResolverservice, makeDomainStoragea pure data layer. Splits request-coupled logic out ofDomainStorage(an entity storage handler) into a newDrupal\domain\DomainResolverservice that ownsRequestStack, hostname normalization, request-scheme detection, path-prefix matching, and the mainresolveDomain()entry point.DomainNegotiatorbecomes a thin orchestrator that delegates to the resolver. TheDOMAIN_MATCHED_*constants move toDomainNegotiationContextas their canonical home, with deprecated aliases onDomainNegotiatorInterfacefor transparent BC. Six read-only consumers (DomainCacheContext,DomainAccessManager, etc.) switch fromDomainNegotiatorInterfaceto the lighterDomainNegotiationContext, reducing service-graph dependencies. Two bug fixes in passing:$_SERVER['https'](lowercase, never set) becomes$_SERVER['HTTPS']in scheme detection;is_defaultfor the first domain correctly defaults to1instead of0. Strict superset for normal flows; deprecation warnings on legacy entry points. - task: #3588246 Extract
DomainAccessManagerstatic helpers (getAccessValues,getAllValue, etc.) to a public utility class. The 5 public statics onDomainAccessManagermove to a newDrupal\domain_access\Utility\DomainAccessFieldsclass. The originals become@deprecatedwrappers with@trigger_error()that delegate to the new class. Ecosystem callers (domain_path,domain_shorturl,domain_extras/domain_access_linkit) keep working through the deprecated path; they should migrate toDomainAccessFields::*at their convenience. Mirrors the precedent set by #3583423 forDomainStorage::createMachineName()→Drupal\domain\Utility\MachineName::fromString(). Behavior preserved; only type tightening on the new utility's signatures. - task: #3584261 Mark internal classes with
@internalto clarify public API boundaries. Adds@internalto ~42 implementation classes (services, event subscribers, path processors, access checkers, validators) that have their own constructor — i.e. classes whose constructor signature is the module's to break. All 16 hook classes are markedfinal(without@internal, since composition is a legitimate ecosystem pattern).DomainNegotiationContextgets@final. Public extension points (interfaces, entities, abstract base classes, public events,DomainAccessControlHandler,DomainCommands,DomainElementManager,DomainConfigOverrideEditable, etc.) are intentionally left unmarked. Pure docblock change — no runtime behavior change.