public function SmartIpEventSubscriber::validateFormSettings in Smart IP 8.3
Same name in this branch
- 8.3 modules/device_geolocation/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\device_geolocation\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
- 8.3 modules/smart_ip_maxmind_geoip2_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_maxmind_geoip2_bin_db\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
- 8.3 modules/smart_ip_ipinfodb_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
- 8.3 modules/smart_ip_ip2location_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_ip2location_bin_db\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
- 8.3 modules/smart_ip_abstract_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_abstract_web_service\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
- 8.3 modules/smart_ip_maxmind_geoip2_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_maxmind_geoip2_web_service\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
Same name and namespace in other branches
- 8.4 modules/smart_ip_maxmind_geoip2_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_maxmind_geoip2_web_service\EventSubscriber\SmartIpEventSubscriber::validateFormSettings()
Act on validation of main Smart IP admin settings form.
Parameters
\Drupal\smart_ip\AdminSettingsEvent $event: Smart IP admin settings override event for event listeners.
Overrides SmartIpDataSourceInterface::validateFormSettings
File
- modules/
smart_ip_maxmind_geoip2_web_service/ src/ EventSubscriber/ SmartIpEventSubscriber.php, line 151 - Contains \Drupal\smart_ip_maxmind_geoip2_web_service\EventSubscriber\SmartIpEventSubscriber.
Class
- SmartIpEventSubscriber
- Core functionalty of this Smart IP data source module. Listens to Smart IP override events.
Namespace
Drupal\smart_ip_maxmind_geoip2_web_service\EventSubscriberCode
public function validateFormSettings(AdminSettingsEvent $event) {
/** @var \Drupal\Core\Form\FormStateInterface $formState */
$formState = $event
->getFormState();
if ($formState
->getValue('smart_ip_data_source') == self::sourceId()) {
if ($formState
->isValueEmpty('maxmind_geoip2_web_service_uid')) {
$formState
->setErrorByName('maxmind_geoip2_web_service_uid', t('Please enter your Maxmind GeoIP2 Precision Web Services user ID.'));
}
if ($formState
->isValueEmpty('maxmind_geoip2_web_service_license_key')) {
$formState
->setErrorByName('maxmind_geoip2_web_service_license_key', t('Please enter your Maxmind GeoIP2 Precision Web Services license key.'));
}
}
}