Issue #3588247: Domain Path Aliases not visible on content translation forms

Fixes #3588247.

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

Adds a functional test on a translatable node:page bundle configured with untranslatable_fields_hide. It asserts that:

  • field_domain_access is hidden on the translation form;
  • the domain_path widget for the assigned domain is visible (the regression);
  • the domain_path widget for an unassigned domain is absent;
  • submitting an alias from the translation form persists a path_alias scoped to the translation langcode and the assigned domain_id.

Credits

Original patch by @webflo.

Merge request reports

Loading