diff --git a/modules/core/map/src/Element/FarmMapWkt.php b/modules/core/map/src/Element/FarmMapInput.php similarity index 96% rename from modules/core/map/src/Element/FarmMapWkt.php rename to modules/core/map/src/Element/FarmMapInput.php index 35668039b..2ac62348e 100644 --- a/modules/core/map/src/Element/FarmMapWkt.php +++ b/modules/core/map/src/Element/FarmMapInput.php @@ -8,9 +8,9 @@ use Drupal\Core\Render\Element\FormElement; /** * Form element that returns WKT rendered in a map. * - * @FormElement("farm_map_wkt") + * @FormElement("farm_map_input") */ -class FarmMapWkt extends FormElement { +class FarmMapInput extends FormElement { /** * {@inheritdoc} @@ -41,7 +41,7 @@ class FarmMapWkt extends FormElement { } /** - * Generates the FarmMapWktform element. + * Generates the form element. * * @param array $element * An associative array containing the properties and children of the diff --git a/modules/core/map/src/Plugin/Field/FieldWidget/GeofieldWidget.php b/modules/core/map/src/Plugin/Field/FieldWidget/GeofieldWidget.php index 49b101d2e..1e10717af 100644 --- a/modules/core/map/src/Plugin/Field/FieldWidget/GeofieldWidget.php +++ b/modules/core/map/src/Plugin/Field/FieldWidget/GeofieldWidget.php @@ -133,8 +133,8 @@ class GeofieldWidget extends GeofieldBaseWidget { */ public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { - // Use the farm_map_wkt form element. - $element['#type'] = 'farm_map_wkt'; + // Use the farm_map_input form element. + $element['#type'] = 'farm_map_input'; // Wrap the map with a unique id for populating from files. $field_name = $this->fieldDefinition->getName(); diff --git a/modules/core/map/tests/modules/farm_map_test/src/Plugin/QuickForm/Test.php b/modules/core/map/tests/modules/farm_map_test/src/Plugin/QuickForm/Test.php index eb02f94fd..2138f812b 100644 --- a/modules/core/map/tests/modules/farm_map_test/src/Plugin/QuickForm/Test.php +++ b/modules/core/map/tests/modules/farm_map_test/src/Plugin/QuickForm/Test.php @@ -30,7 +30,7 @@ class Test extends QuickFormBase { // Geometry field with a default value and no raw data textfield. $form['geometry1'] = [ - '#type' => 'farm_map_wkt', + '#type' => 'farm_map_input', '#title' => $this->t('Geometry 1'), '#display_raw_geometry' => FALSE, '#default_value' => 'POINT(-42.689862437640826 32.621823310499934)', @@ -38,7 +38,7 @@ class Test extends QuickFormBase { // Geometry field without a default value and a raw data field. $form['geometry2'] = [ - '#type' => 'farm_map_wkt', + '#type' => 'farm_map_input', '#title' => $this->t('Geometry 2'), '#display_raw_geometry' => TRUE, ];