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.
DBTNG no longer supports chaining on db_select(), so lines 286-290 of actions.inc don't work.
The code currently reads:
$results = db_select('actions')
->addField('actions', 'aid')
->addField('actions', 'description')
->condition('callback', $orphaned, 'IN')
->execute();
We probably want something more like:
$query = db_select('actions');
$query->addField('actions', 'aid');
$query->addField('actions', 'description');
$query->condition('callback', $orphaned, 'IN');
$results = $query->execute();
However, if #314464: Convert db_placeholders() to DBTNG is resolved, this should probably be changed into a static query using db_query() rather than db_select().
Comment | File | Size | Author |
---|---|---|---|
#10 | 332266_actions_query.patch | 1012 bytes | mr.baileys |
#9 | 332266_actions_query.patch | 1012 bytes | mr.baileys |
#6 | 332266_actions_query.patch | 1.02 KB | mr.baileys |
Comments
Comment #1
Dave ReidYeah that was my bad. I didn't know that db_select couldn't be chained like db_insert/update/delete...
Comment #2
Dave ReidAssigning myself to fix this.
Comment #4
Dave ReidComment #5
Dave ReidComment #6
mr.baileysI ran into this issue while working on #306662: Add redirect option to site-wide contact forms.
@Dave Reid, I hope you don't mind but since I had to get past this error I rolled a patch according to cwgordon7's instructions...
Comment #7
cwgordon7 CreditAttribution: cwgordon7 commentedWell, since #314464: Convert db_placeholders() to DBTNG has been resolved, I believe this query can probably be converted to a static db_query() query?
Comment #8
Dave Reid@mr.baileys No problem at all. :)
Agreed with cwgordon7. This can be a nice db_query()->fetchAll() function now.
Comment #9
mr.baileysre-rolled taking the comments from #7 and #8 into account. If this gets commited, credit goes to Dave Reid and cwgordon7, as I merely poured their code into patch-form.
Comment #10
mr.baileysLet's use single-quotes instead :)
Comment #11
Dave ReidTested manually and works, looks good, and testbot likes. We have more extensive tests for orphaned actions coming.
Comment #12
Dries CreditAttribution: Dries commentedCommitted -- and looking forward to those tests. :-)