Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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)
Comment | File | Size | Author |
---|---|---|---|
bug--text-area-field-has-geocoder.png | 156.12 KB | chriscalip | |
geofield-has-geocoder-form.png | 151.18 KB | chriscalip | |
node-type-fields-definition.png | 144.58 KB | chriscalip |
Comments
Comment #2
GreenSkunkThe 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:
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()]);
Comment #3
Pol