Issue #3588247: Domain Path Aliases not visible on content translation forms (2.x backport)

Backport of !114 to the 2.x branch.

Fixes #3588247 on domain_path 2.x — same regression, same fix.

Verified that the 6 commits from !114 cherry-pick cleanly:

  • src/DomainPathFormHelper.php is byte-identical between 2.x and 3.x, so the patch applies as-is.
  • tests/src/Functional/DomainPathTestBase.php and DomainPathNoAccessTestBase.php are also identical, so the new functional test runs against the same fixture.
  • core_version_requirement matches (^10.3 || ^11) — same supported environments.

What this fixes

When content_translation hides untranslatable fields on a translation form, the field_domain_access widget is removed from the DOM. The JS States API that toggles domain_path widget visibility can no longer fire because its dependee inputs are not on the page, so every domain path widget stays masked by the pre-#states display:none hider.

Fix

Decide visibility server-side from the entity's stored values whenever content_translation hides untranslatable fields on the form:

  • show the domain path widget for the domains the entity is published to (field_domain_access);
  • show every domain path widget when "all affiliates" is set (field_domain_all_affiliates);
  • mark the rest with #access = FALSE.

When untranslatable fields are not hidden, the existing JS States approach is left untouched.

Tests

Same functional test as !114 (DomainPathContentTranslationVisibilityTest).

Credits

Original patch by @webflo.

Merge request reports

Loading