Base table or view not found

Created on 5 September 2024, 3 months ago

Problem/Motivation

The module doesn't work for me. When I add the field, the following error occurs:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_d10.commerce_order_report' doesn't exist: show columns from commerce_order_report; Array ( ) in Drupal\views_sql_twig_fields\Plugin\views\field\ViewsSqlTwigFieldsField->getSqlFieldForm() (Zeile 69 in /web/modules/contrib/views_sql_twig_fields/src/TwigSqlFields.php).

I tried to use it based on commerce_reports.

I've enabled aggregation on the view, so my suggestion for the reason is that it either doesn't work with aggregation or with table prefixes yet?

Any ideas?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah it's missing handling of table prefixes. All our tables are prefixed with wd_ via settings.php

  • Merge request !2Update TwigSqlFields.php → (Open) created by Anybody
  • Status changed to Needs work 3 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Drupal uses curly braces to surround table names for prefix support in sql queries, but the MR doesn't seem to be enough?

  • Status changed to Needs review 3 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Heeey it works, it needed double curly braces, because the inner ones are used by PHP for variables in double quotes 😁

  • Status changed to RTBC 3 months ago
Production build 0.71.5 2024