Exposed filter as a block does not keep contextual filter parameters

Created on 25 May 2025, 6 days ago

Problem/Motivation

When contextual filters exist and the filter is exposed as a block, the search does not keep the contextual filter parameters(s).

Steps to reproduce

Pre-requisite:

Create a View with exposed filters:

  • Create a View for Users
  • Under "Advanced" for the view, add "Relationship: User group relationship" - Group membership and select "Require this relationship"
  • Add a contextual filter for "Group relationship: Parent group"
  • For Exposed form in block, select No
  • Add some Fields to the view, such as username
  • Add some exposed Filter Criteria and expose them: such as username
  • For the view Page path: assign the path with the group ID as part of the URL: "group/%group/people"
  • Save the view

Execute the search:

  • On the search page, search for some username.
  • Notice that the URL retains the group ID, something like: https:///group/4/people?, where "4" is the group id.
  • Now go back to edit the View, and change "Exposed form in block" to Yes
  • Go to Block Layout and add the exposed filter block to the appropriate page/group. Save the block layout.
  • Search for some username again.
  • Note that the URL, when executing the search, did not keep the group ID (the contextual filter param). URL looks something like this: https://anxdevwks-41.ds.annex.peratondev.lab/group/all/people?

Workaround

Do not expose the filter as a block if contextual filters exists.

πŸ› Bug report
Status

Active

Version

7.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024