Causes Views with Contextual filter and default set to query parameter to ignore the contextual filters with OR

Created on 18 June 2025, 19 days ago

Problem/Motivation

When the Trash module is installed and is enabled for content, it causes views with contextual filters that get the default value from a query parameter fail.

Steps to reproduce

  1. git clone https://git.drupalcode.org/project/drupal.git
  2. composer install
  3. composer require drush/drush
  4. composer require drupal/views_contextual_filters_or:^1.5
  5. drush site:install -y
  6. drush en views_contextual_filters_or
  7. Create Article content
  8. Create a Views block with contextual filter for the title and provide default by query parameter (e.g. param)
  9. Edit view with contextual filter for the body and provide a second default by query parameter (same as the first - param)
  10. Edit view and check [Advanced - Other - Query settings - Contextual filters OR] box
  11. place block in block layout (it won't show in preview when editing the view)
  12. Visit page and confirm query returns expected results
  13. composer require drupal/trash
  14. composer install
  15. drush en trash
  16. Check [Enabled entity types content] box on /admin/config/content/trash page
  17. clear cache
  18. navigate to page block is on
  19. the or contextual filters are ignored
🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @serverjohn
  • 🇷🇴Romania amateescu

    I tried to reproduce this using the steps in the issue summary and I couldn't get the view to display anything after adding the second contextual filter. Can you please update the steps with actual values? Even node title and values for the body field would help to ensure that I'm testing your specific scenario.

    And you can leave out the parts about adding the modules, installing the site, etc. as they're not necessary :)

Production build 0.71.5 2024