Skip to content

Issue #3517987: Add option to contextual filters to encode slashes in query parameter.

Problem/Motivation:

Views contextual filter break the page when value contains slashes if a views data export display is attached to the view page:

Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "arg_0" for route "view.search.data_export_1" must match "[^/]++" ("ABC/000/DE/1234" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 209 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Steps to reproduce:

  • Create a search api solr view page.
  • Add a "Fulltext search" contextual filter.
  • Add a "Data export" view display and attach it to the view page.
  • Save the view.
  • Go to the search page and enter search by a keyword with slashes (ie.: ABC/000/DE/1234)
  • Page will break with the error mentioned above

Proposed solution:

Based on the solution from the issue #3298347, the solution is encoding the forwards slashes in the query parameter.

Merge request reports

Loading