Commit 94098ff4 authored by catch's avatar catch

Issue #2431085 by xjm, pjbaert, Jo Fitzgerald: Validation error for manually...

Issue #2431085 by xjm, pjbaert, Jo Fitzgerald: Validation error for manually entered paths in the link widget is a little confusing
parent 87646bb8
......@@ -139,7 +139,7 @@ public static function validateUriElement($element, FormStateInterface $form_sta
// @todo '<front>' is valid input for BC reasons, may be removed by
// https://www.drupal.org/node/2421941
if (parse_url($uri, PHP_URL_SCHEME) === 'internal' && !in_array($element['#value'][0], ['/', '?', '#'], TRUE) && substr($element['#value'], 0, 7) !== '<front>') {
$form_state->setError($element, t('Manually entered paths should start with /, ? or #.'));
$form_state->setError($element, t('Manually entered paths should start with one of the following characters: / ? #'));
return;
}
}
......
......@@ -147,7 +147,7 @@ public function testURLValidation() {
// Define some invalid URLs.
$validation_error_1 = "The path '@link_path' is invalid.";
$validation_error_2 = 'Manually entered paths should start with /, ? or #.';
$validation_error_2 = 'Manually entered paths should start with one of the following characters: / ? #';
$validation_error_3 = "The path '@link_path' is inaccessible.";
$invalid_external_entries = [
// Invalid protocol
......
......@@ -105,7 +105,7 @@ public function testMenuLinkContentFormValidation() {
],
t('Save')
);
$this->assertText(t('Manually entered paths should start with /, ? or #.'));
$this->assertText(t('Manually entered paths should start with one of the following characters: / ? #'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment