Views arguments not passed to views_get_view_result() when checking for results ViewContent::render()

Created on 22 December 2020, over 4 years ago
Updated 10 December 2024, 7 months ago

Problem/Motivation

i'm checking out the latest release 8.x-3.0-alpha4 (and dev) and notice that this commit https://git.drupalcode.org/project/quicktabs/commit/fb696fe from #2909326: Empty Views Tabs still being rendered β†’ is causing views to return empty if they require an argument.

The call to views_get_view_result() is not passing the arguments. The problem is views_get_view_result() wants the arguments as individual variables passed on the end of the function ($vid, $display, $arg1, $arg2, etc), not in an array as we have it. Unless I'm missing something, I'm not sure we can pass along these variables using that function.

Steps to reproduce

  • Create a view that requires an argument to show results.
  • Set up your first tab to use this view and provide a variable argument fromthe page (%1, %2, etc).
  • No content is shown.

Proposed resolution

Create a new method in ViewContent.php that duplicates the logic of views_get_view_result() but allows the variables to be passed in an array. Maybe something like viewIsEmpty($vid, $display, $args); ?

Does that make sense or is there a better way to do this?

πŸ› Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024