Skip to content

DP-45938-Restrict-“Map”-Field-on-Organization-Pages-to-Location-Content-Types-Only - #3452

Open
jarielrrz wants to merge 8 commits into
developfrom
feature/DP-45938-Restrict-“Map”-Field-on-Organization-Pages-to-Location-Content-Types-Only

Hidden character warning

The head ref may contain hidden characters: "feature/DP-45938-Restrict-\u201cMap\u201d-Field-on-Organization-Pages-to-Location-Content-Types-Only"
Open

DP-45938-Restrict-“Map”-Field-on-Organization-Pages-to-Location-Content-Types-Only#3452
jarielrrz wants to merge 8 commits into
developfrom
feature/DP-45938-Restrict-“Map”-Field-on-Organization-Pages-to-Location-Content-Types-Only

Conversation

@jarielrrz

Copy link
Copy Markdown
Collaborator

Restrict Map fields on Organization and Service pages to Location content.

…Organization-Pages-to-Location-Content-Types-Only
@joeg8612
joeg8612 temporarily deployed to Tugboat July 16, 2026 00:39 Destroyed
Comment thread docroot/modules/custom/mass_validation/mass_validation.module Outdated

@dstorozhuk dstorozhuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on the tests (see also the #[Hook] suggestion above).

Comment on lines +66 to +73
/**
* Assert the service page Layout Paragraphs path rejects non-locations.
*
* Service pages edit the Map field through the Layout Paragraphs component
* form, whose #validate handler calls validateLayoutParagraphForm(). This
* exercises that path directly with both invalid and valid references.
*/
public function testServicePageLayoutParagraphsPathRejectsNonLocationReference(): void {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't actually exercise the service-page path it's named after — it hand-builds a FormState and calls the validator service directly, so it keeps passing even if the case 'org_locations': wiring in mass_validation_form_layout_paragraphs_component_form_alter() is deleted or the LP component form's value structure changes. The only wiring it verifies is the services.yml registration.

Options:

  • Upgrade it to a real LP component-form test — there's a ready-made template in this module: tests/src/ExistingSiteJavascript/CollectionSearchValidationLayoutParagraphsTest.php (drives the LP modal on a service_page, submits an invalid value, asserts the error in the dialog).
  • Or rename it (e.g. testValidatorServiceRejectsNonLocationReference) so it doesn't read as end-to-end coverage.
  • If the #[Hook] / #validate_reference approach is adopted instead, this test can simply be dropped — the org_page browser test above already proves the widget-level validation fires.

…Organization-Pages-to-Location-Content-Types-Only
@joeg8612
joeg8612 temporarily deployed to Tugboat July 20, 2026 13:53 Destroyed
@joeg8612
joeg8612 temporarily deployed to Tugboat July 21, 2026 05:00 Destroyed
@joeg8612
joeg8612 temporarily deployed to Tugboat July 28, 2026 04:57 Destroyed
…Organization-Pages-to-Location-Content-Types-Only
@joeg8612
joeg8612 temporarily deployed to Tugboat August 3, 2026 20:14 Destroyed
@joeg8612
joeg8612 temporarily deployed to Tugboat August 4, 2026 04:58 Destroyed
…Organization-Pages-to-Location-Content-Types-Only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants