Skip to content
Snippets Groups Projects
Commit f727d828 authored by Andrey Vitushkin's avatar Andrey Vitushkin
Browse files

Issue #3446907: Fix the issue where the error message would appear when creating a new field

parent 678fa1be
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,10 @@ final class IpAddressMySqlWidget extends WidgetBase implements ContainerFactoryP
*/
public function validateIpAddress(array &$element, FormStateInterface $form_state, array $form) {
$value = trim($element['#value']);
if ($value === '') {
return;
}
if (!MySqlFormatConstraintValidator::validateCidr($value)) {
$message = $this->t('The IP address value must follow <a href=:url target="_blank">CIDR notation</a>.', [
':url' => 'https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing',
......
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