Problem/Motivation

When an active exposed filter has a value that includes a colon (e.g., a full URL like https://api.example.com), the "clear filter" functionality breaks. The current code that handles removal of filter values splits the data-remove-selector string using split(':'), which incorrectly captures only the part before the colon (e.g., https), instead of the full value.

Steps to reproduce

  1. Add an exposed filter using Views Filters Summary.
  2. Select or input a value that contains a colon, such as a full URL (e.g., https://api.example.com).
  3. Click the "remove" or "clear" control for that filter.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mxr576 created an issue. See original summary.

mxr576’s picture

Title: When filter value contains an URL, remove filter breaks » Filter removal breaks for values containing colons (e.g., URLs)
mably’s picture

Nice catch @mxr576!

What do you think of replacing the colon character by a more specific character like pipe or something?

mxr576’s picture

Status: Active » Needs review
mxr576’s picture

@mably, that could also work, but I did not want to touch the core logic of filtering since fixing this specific problem was quite simple and did not require any dirty workarounds.

mably’s picture

Status: Needs review » Fixed

Ok, let's merge it as is then.

mably’s picture

Released in 3.1.0-rc3.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.