Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | D8-2745971-bad-query.patch | 1002 bytes | david_garcia |
Comments
Comment #2
david_garcia CreditAttribution: david_garcia commentedComment #3
jmuzz CreditAttribution: jmuzz commented8.x-2.x is no longer being developed or supported.