%s instead of %d in actions_delete()

pcorbett - March 23, 2009 - 18:01
Project:Actions
Version:5.x-2.6
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:active
Description

In the actions.inc file, the last function, actions_delete(), uses the %d modifier for a varchar column (aid), when it should be %s.

Thus,

function actions_delete($aid) {
  db_query("DELETE FROM {actions} WHERE aid = %d", $aid);
  module_invoke_all('actions_delete', $aid);
}

Becomes,

/**
* Delete a single action from the database.
*
* @param $aid
*   integer The ID of the action to delete.
*/
function actions_delete($aid) {
  db_query("DELETE FROM {actions} WHERE aid = '%s'", $aid);
  module_invoke_all('actions_delete', $aid);
}

 
 

Drupal is a registered trademark of Dries Buytaert.