Problem :
Geocoder Form Settings appears in a field type : Text (formatted, long, with summary)

Example :
machine-name:field_asset_address,field-type: Address
machine-name:field_asset_description,field-type:Text (formatted, long, with summary)
machine-name:field_asset_geofield,field-type:Geofield

Image Snapshots :
- node-type-fields-definition.png
Shows a node type's fields.
- geofield-has-geocoder-form.png
Geocoder form settings correctly shows in a geofield.
- bug--text-area-field-has-geocoder.png
Bug! Geocoder Form Settings appears in a field type : Text (formatted, long, with summary)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chriscalip created an issue. See original summary.

GreenSkunk’s picture

The select field for "Geocode from an existing field" appears to be designed to output the select options in the format of "Label (Name) [Type] "
Found where it is defined and making note. ON line 114 of geocoder\modules\geocoder_field\src\Plugin\Geocoder\Field\DefaultField.php in the public function getSettingsForm() the #options are set by $this->fieldPluginManager->getSourceFields($field->getTargetEntityTypeId(), $field->getTargetBundle(), $field->getName())
In \geocoder\modules\geocoder_field\src\GeocoderFieldPluginManager.php on line 97 the options are set with the following line:

$options[$id] = new TranslatableMarkup('@label (@name) [@type]', ['@label' => $definition->getLabel(), '@name' => $definition->getName(), '@type' => $definition->getType()]);

I'd guess that a use case would be a system that has a lot of fields with the same/similar label but different field names.
If it was really bothersome then that line could be modified to
$options[$id] = new TranslatableMarkup('@label', ['@label' => $definition->getLabel()]);

Pol’s picture

Status: Active » Closed (outdated)