Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Please replace with:
/**
* Implements hook_node_delete().
*/
function feeds_imagegrabber_node_delete($node) {
if (isset($node->nid) && is_numeric($node->nid)) {
db_delete('feeds_imagegrabber')
->condition('feed_nid', $node->nid)
->execute();
}
}
The current implementation is broken and against documentation:
Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively.
(https://api.drupal.org/api/drupal/includes%21database%21database.inc/fun...)
Comment | File | Size | Author |
---|---|---|---|
#2 | replace-feeds-imagegrabber-node-delete-2748459.patch | 780 bytes | ashwinsh |
Comments
Comment #2
ashwinshHello Anybody,
Added a patch file for the same, please check it.
Thank you,
Comment #3
Chalk CreditAttribution: Chalk at DrupalSquad commentedI confirm that #2 solves the error during a node deletion - bug was reproduced at the Pantheon hosting (PHP 7). But at local environment (PHP 5.6) the error was not reproduced.
Comment #4
rooby CreditAttribution: rooby commentedFor people searching, this issue causes this error message:
Comment #6
rooby CreditAttribution: rooby commentedThanks for the patch.
This is committed, although I made the following minor changes:
* Removed the if condition around the delete, as it isn't necessary in this case.
* Fixed the indentation.
Comment #8
Jee CreditAttribution: Jee commentednevermind