Problem/Motivation

Steps to reproduce:

  • Add a couple of url aliases
  • Go to /admin/config/search/path and try to find "tags/example"
  • As result you get:
    Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "keys" for route "/admin/config/search/path/list/{keys}" must match "[^/]++" ("tags/example" given) to generate a corresponding URL. in Symfony\Component\Routing\Generator\UrlGenerator->doGenerate() (line 167 of core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php).
    Symfony\Component\Routing\Generator\UrlGenerator->doGenerate([Array], [Array], [Array], [Array], [Array], /admin/config/search/path/list/{keys}, FALSE, [Array])
    Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute(Symfony\Component\Routing\Route, [Array])
    Drupal\Core\Routing\UrlGenerator->generateFromRoute(path.admin_overview_filter, [Array], [Array])
    Drupal\Core\Url->toString()
    Drupal\Core\Form\FormSubmitter->redirectForm(Drupal\Core\Form\FormState)
    Drupal\Core\Form\FormSubmitter->doSubmitForm([Array], Drupal\Core\Form\FormState)
    Drupal\Core\Form\FormBuilder->processForm(path_admin_filter_form, [Array], Drupal\Core\Form\FormState)
    Drupal\Core\Form\FormBuilder->buildForm(Drupal\path\Form\PathFilterForm, Drupal\Core\Form\FormState)
    Drupal\Core\Form\FormBuilder->getForm(Drupal\path\Form\PathFilterForm, NULL)
    Drupal\path\Controller\PathController->adminOverview(NULL)
    call_user_func_array([Array], [Array])
    Drupal\Core\Controller\HtmlPageController->getContentResult(Symfony\Component\HttpFoundation\Request, \Drupal\path\Controller\PathController::adminOverview)
    Drupal\Core\Controller\HtmlPageController->content(Symfony\Component\HttpFoundation\Request, \Drupal\path\Controller\PathController::adminOverview)
    call_user_func_array([Array], [Array])
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Symfony\Component\HttpFoundation\Request, 1)
    Symfony\Component\HttpKernel\HttpKernel->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
    Drupal\Core\StackMiddleware\PageCache->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
    Stack\StackedHttpKernel->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
    Drupal\Core\DrupalKernel->handle(Symfony\Component\HttpFoundation\Request)
    

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

benelori’s picture

We need form level validation for this, with a nice error message I think. Should we do just this or should we enforce some rule in the path.routing.yml file as well?

PS: I also have a question that is partially related to this, although might need separate issue...if we don't allow searching for 'tags/example', then we shouldn't be able to add it either, right?

PS1: completely separate topic...why isn't this page a view?

berdir’s picture

No, we do not need form validation, tags/example is a perfectly valid search. what we need to change is make the search parameter a ?q=tags/example like redirect, like we already do for searches.

dawehner’s picture

As alternative we could urlencode this particular search string.

Does someone know how this used to work in D7?

berdir’s picture

This is broken in 7.x too, there are existing issues. It just doesn't fail that hard, it simply ignores everything after the first /.

You might want to find the existing issue, promote to critical and close this as duplicate?

dawehner’s picture