Views contextual filters with multiple values do not work with arguments containing spaces

Created on 21 February 2019, over 5 years ago
Updated 3 August 2023, 10 months ago

Views contextual filters with multiple values do not work with arguments containing spaces.

This issue is summarized and is being addressed in D7 Views module: https://www.drupal.org/project/views/issues/1027458 β†’ .

Attached is a patch adapted from the above issue, it provides an extra option "Preserve spaces with multiple values" that fixes the issue when selected.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mukhsim

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    There is a bigger problem here, which imo is relevant to this thread.

    Because of how this regex is written - [\w0-9-_\.], contextual filters do not work with arguments that contain any non-word characters.

    Just about any special character including common ASCII - !@#$%^&*()/\<>?"'~`= for example - will break the regex, and the view will silently fail.

    IMO, a proper fix would address this failure, and not be limited to this one very specific shortcoming about whitespace.

    Also needs tests to prevent further regression.

  • Status changed to Needs review about 1 year ago
  • last update about 1 year ago
    29,365 pass, 1 fail
  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    Here are tests that will demonstrate the failure with regard to special characters and spaces.
    While writing these tests, I discovered that existing tests already account for the undocumented space-delimiting behavior of the contextual argument handler, dating back to views 7.x, before it was included into core.

    So, bug or not, any change may break contrib space and will require a change record.

    Will need framework maintainer to weigh in as well.

  • Status changed to Needs work 10 months ago
  • I've spent the last few hours troubleshooting an issue that came down to exactly what AaronBauman mentions in #26. In my case, the field has an equals sign (=). I may be able to come up with a workaround for my case, but a fix for this would be greatly appreciated.

Production build 0.69.0 2024