Skip to content
Snippets Groups Projects
Commit a349287e authored by chetan's avatar chetan Committed by Sylvain MICHEL
Browse files

Issue #3404495 by chetan 11: Warning: Undefined array key 0 in...

Issue #3404495 by chetan 11: Warning: Undefined array key 0 in webform_geoip_restriction_webform_third_party_settings_form_alter() (line 117 of modules/contrib/webform_geoip_restriction/webform_geoip_restriction.module)
parent c00d1fdb
No related branches found
No related tags found
No related merge requests found
......@@ -112,10 +112,11 @@ function webform_geoip_restriction_webform_third_party_settings_form_alter(&$for
],
];
$my_country = \Drupal::service('ip2country.lookup')->getCountry();
$country_name = isset($options[$my_country]) ? $options[$my_country] : 'local';
$form['third_party_settings']['webform_geoip_restriction']['info'] = [
'#type' => 'markup',
'#markup' => '<div class="messages messages--info">' . t('Your country is %country', ['%country' => $options[$my_country] ?: 'local']) . '</div>',
];
'#markup' => '<div class="messages messages--info">' . t('Your country is %country', ['%country' => $country_name]) . '</div>',
];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment