Issue #2431085 by xjm, pjbaert, Jo Fitzgerald: Validation error for manually entered paths in the link widget is a little confusing
parent
87646bb85a
commit
94098ff42e
|
@ -139,7 +139,7 @@ class LinkWidget extends WidgetBase {
|
|||
// @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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
|
||||
// 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 @@ class MenuLinkContentFormTest extends BrowserTestBase {
|
|||
],
|
||||
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: / ? #'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue