Problem/Motivation

The module is doing bad usage of the database abstraction layer. To make matters worse, it is using GRAVE ACCENT (AKA Backtick) that is out of the SQL Standard, completely breaking the query in database engines other than MySQL.

This is the offending code:

$host_id_results = \Drupal::database()->query('SELECT `entity_id` FROM {' . $table . '} ' . 'WHERE `' . $this->bundle() . '_value` = ' . $this->id())->fetchCol();

Proposed resolution

Build the query using Database::select instead, so that DTBNG can properly translate the query to the underlying database engine.

Remaining tasks

RTBC

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 D8-2745971-bad-query.patch1002 bytesdavid_garcia
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

david_garcia created an issue. See original summary.

david_garcia’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1002 bytes
jmuzz’s picture

Status: Needs review » Closed (won't fix)

8.x-2.x is no longer being developed or supported.