And/Or not working with drupal_view() or drupal_view_result()

Created on 26 January 2023, over 1 year ago
Updated 26 February 2023, over 1 year ago

Problem/Motivation

When using {{ drupal_view('view_id', 'block_id', 'tid_1,tid_2') }} results return the arguments with an 'or' clause instead of with an 'and'

According the the views contextual filters allow multiple helper text:
Allow multiple values
If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).

According to this {{ drupal_view('view_id', 'block_id', 'tid_1+tid_2') }} should render the view with the OR clause and
{{ drupal_view('view_id', 'block_id', 'tid_1,tid_2') }} should render with the AND instead of them both rendering as if with the OR clause.

This may be an issue with the views_embed_view() function in core, but I'm starting here for now.

Steps to reproduce

Create a view with content tagged with various taxonomies. Create a entity (node, paragraph, block, etc.) type with a views reference field and use drupal_view or drupal_view_result in the twig template.

Proposed resolution

Add logic to allow the AND clause to work.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: cannot reproduce

Version

3.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Topplestack Rural, Idaho

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

Comments & Activities

  • Issue created by @Topplestack
  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡·πŸ‡ΊRussia Chi

    Could not reproduce. Argument conditions (AND/OR) work as expected for me. Looks like you are having some sort of caching issue.

  • Status changed to Closed: cannot reproduce over 1 year ago
Production build 0.69.0 2024