public static function GeocodeOrigin::validatePluginsSettingsForm in Geocoder 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/GeofieldProximitySource/GeocodeOrigin.php \Drupal\geocoder\Plugin\GeofieldProximitySource\GeocodeOrigin::validatePluginsSettingsForm()
File
- src/
Plugin/ GeofieldProximitySource/ GeocodeOrigin.php, line 357
Class
- GeocodeOrigin
- Defines 'Geocode Origin (with Autocomplete option)' proximity source plugin.
Namespace
Drupal\geocoder\Plugin\GeofieldProximitySourceCode
public static function validatePluginsSettingsForm(array $element, FormStateInterface &$form_state) {
$plugins = is_array($element['#value']) ? array_filter($element['#value'], function ($value) {
return isset($value['checked']) && TRUE == $value['checked'];
}) : [];
if (empty($plugins)) {
$form_state
->setError($element, t('The Geocode Origin option needs at least one geocoder plugin selected.'));
}
}