diff --git a/modules/core/map/src/Element/FarmMapInput.php b/modules/core/map/src/Element/FarmMapInput.php index 6740cad4f..6850b144d 100644 --- a/modules/core/map/src/Element/FarmMapInput.php +++ b/modules/core/map/src/Element/FarmMapInput.php @@ -85,6 +85,7 @@ class FarmMapInput extends FormElement { $element['value'] = [ '#type' => $display_raw_geometry ? 'textarea' : 'hidden', '#title' => $element_title . ' ' . t('WKT'), + '#title_display' => 'invisible', '#attributes' => [ 'data-map-geometry-field' => TRUE, ], diff --git a/modules/core/map/tests/src/Functional/MapFormTest.php b/modules/core/map/tests/src/Functional/MapFormTest.php index c78d9ca71..34693b5d5 100644 --- a/modules/core/map/tests/src/Functional/MapFormTest.php +++ b/modules/core/map/tests/src/Functional/MapFormTest.php @@ -31,11 +31,13 @@ class MapFormTest extends FarmBrowserTestBase { $this->drupalLogin($user); // Go to the test quick form and confirm that both of the geometry fields - // are visible. + // are visible, and only the second field's WKT text field is visible. $this->drupalGet('quick/test'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains($this->t('Geometry 1')); $this->assertSession()->pageTextContains($this->t('Geometry 2')); + $this->assertSession()->pageTextNotContains($this->t('Geometry 1 WKT')); + $this->assertSession()->pageTextContains($this->t('Geometry 2 WKT')); // Submit the form with a value for the second geometry. $edit = ['geometry2[value]' => 'POINT(-45.967095060886315 32.77503850904169)'];