"Pass Contextual Filters" option is broken on multiple sorts

Created on 25 January 2023, over 1 year ago
Updated 5 March 2024, 4 months ago

Problem/Motivation

When 2 or more sorts if used on the view, when first uses "Pass Contextual Filters" and the last has it turned off, arguments aren't used for sorting. All joins in the views query miss "args" field.

Steps to reproduce

Add 2 filters to the view with different "Pass Contextual Filters" configuration. Check views query in the preview. Both uses configuration from the last.

Proposed resolution

The "draggableviews_with_args" join plugin looks for the options in the last DraggableViewsSort sort plugin, but not in the exact one. Pass this option to the sort plugin as configuration and don't lookup across all the view sorts.

User interface changes

No

API changes

I don't include it in patch, but I propose to remove "hook_draggableviews_join_withargs_alter()". The hook is called in the "draggableviews_with_args" views join plugin and its a main part of its functionality. But the join plugin could be altered itself with "join_id" key in views definition, and make necessary changes. I think I'll create a separate issue later to discuss it.

Data model changes

No

πŸ› Bug report
Status

RTBC

Version

2.1

Component

Code

Created by

πŸ‡§πŸ‡ΎBelarus dewalt

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

Comments & Activities

Production build 0.69.0 2024