Not able to differentiate the condition on existing table -- hook_views_query_alter

Created on 4 April 2021, about 3 years ago
Updated 22 January 2024, 5 months ago

Problem/Motivation



    $condition = some_existing_table_in_view_query.column;
    // This condition is passed as string always.
    // View is not able to differentiate the above condition.

    $another_sub_query = \Drupal::database()->select('table2', 'v2');
    $another_sub_query->condition('v2.column2', $condition);

    $sub_query = \Drupal::database()->select('table2', 'v1');
    $sub_query->condition('v1.column1', $another_sub_query);
    $sub_query->condition('v1.column2', $condition);

    $view->query->where[1]['conditions'][] = ['field' => 'table1.column', 'value' => $sub_query, 'operator' => '='];

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Database 

Last updated about 3 hours ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇳India nitin.k INDIA

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • 🇳🇿New Zealand DanielVeza Brisbane, AU

    Thanks for raising an issue!

    The problem here isn't super clear to me. Could you please add some more detail about the problem to the issue statement ideally following the issue template here ?

  • Status changed to Closed: outdated 5 months ago
  • 🇺🇸United States smustgrave

    Since there hasn't been a follow up going to close for now. If still a valid bug please reopen updating issue summary per #7

Production build 0.69.0 2024