Views is broken with non-Sql query plugins

Created on 7 May 2015, over 9 years ago
Updated 2 February 2023, almost 2 years ago

Problem/Motivation

\Drupal\views\Plugin\views\HandlerBase contains this gem:

  public function ensureMyTable() {
    if (!isset($this->tableAlias)) {
      $this->tableAlias = $this->query->ensureTable($this->table, $this->relationship);
    }
    return $this->tableAlias;
  }

The $this->query property is documented as an instance of \Drupal\views\Plugin\views\query\QueryPluginBase, which does not have an ensureTable() method, however. The only real subclass of QueryPluginBase is the Sql implementation which has the ensureTable() method. The QueryTest test implementation has an empty ensureTable() method, probably because it is required due to this bug.

The Search API β†’ module provides an alternate views query plugin, which does not provide an ensureTable() method leading to fatal errors.

Proposed resolution

?

Remaining tasks

User interface changes

API changes

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

  • Triaged core major

    There is consensus among core maintainers that this is a major issue. Only core committers should add this tag.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Think instead of removing it should be deprecated first
    #41 applies but had a bunch of failures

    Definitely think it will need a change record.

Production build 0.71.5 2024