Skip to content
Snippets Groups Projects
Commit cd4831aa authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-5866: improve error message text and show originally entered path

parent bc1f9273
No related branches found
No related tags found
3 merge requests!286ISTWCMS-5866 Prevent URL aliases being created for reserved paths,!274Draft: ISTWCMS-5551: fixing office hours display,!260Feature/istwcms 5668 a5kulkar rename references to publications
...@@ -958,6 +958,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st ...@@ -958,6 +958,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st
// Get the alias from the form state values. // Get the alias from the form state values.
$alias = $values['path'][0]['alias']; $alias = $values['path'][0]['alias'];
$orig_alias = $alias;
// Trim any surrounding slashes from the alias to // Trim any surrounding slashes from the alias to
// ensure that we are getting exact matches for the // ensure that we are getting exact matches for the
...@@ -981,7 +982,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st ...@@ -981,7 +982,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st
) { ) {
// Set an error message if alias exists. // Set an error message if alias exists.
$form_state->setError($form['path']['widget'][0]['alias'], t('@url cannot be an alias.', ['@url' => $alias])); $form_state->setError($form['path']['widget'][0]['alias'], t('The alias "@url" is a reserved path that cannot be used.', ['@url' => $orig_alias]));
} }
} }
......
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