When I delete an invitation, I get the following error. I am using mysql 4.1.21.
Thanks
John

* warning: Invalid argument supplied for foreach() in /home/jmiller/public_html/modules/node.module on line 359.
* warning: implode() [function.implode]: Bad arguments. in /home/jmiller/public_html/modules/node.module on line 363.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/jmiller/public_html/includes/database.mysql.inc on line 120.

Comments

mr john’s picture

Title: Sql syntax error when deleting an invitation » Invalid argument supplied for foreach() in node.module on line 359

I dumped out $param and it seems its value is cancel. Does this make sense to anyone... It seems to me there maybe some confirmation for the delete somewhere and this function is getting confused...

mr john’s picture

Since I'm a complete newbie at this I not quite sure what is going on but here's what I think:

function invite_delete($email) {
global $user;
$email = urldecode($email);
if ($email){
db_query("DELETE from {invite} WHERE email = '%s'",$email);
drupal_set_message("Invitation to $email has been deleted");
$args = array('email' => $email);
module_invoke_all('invite', 'cancel', $args); // I THINK THIS IS WHERE THE cancel IS COMING FROM
drupal_goto('invite');
}
}

function module_invoke_all() {
$args = func_get_args();
$hook = array_shift($args); // THIS MAKES cancel THE FIRST ARG
$return = array();
foreach (module_implements($hook) as $module) {
$function = $module .'_'. $hook;
$result = call_user_func_array($function, $args); // cancel PASSED INTO THROUGH HERE
if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
}
else if (isset($result)) {
$return[] = $result;
}
}

return $return;
}

Not sure how to continue from here....but cancel doesn't seem be in key=>value pair.

finch’s picture

Did you get this sorted out? I have the same error when people register via invite. Seems noticing this error only when I upgraded to MySQL 4.1.

Similar error message has seen by others like here and here from different calling module.

Nick Wilson’s picture

Hi, if anyone would care to submit a patch i'll be happy to implement it. thanks for reporting this.

mr john’s picture

I wasn't too sure how to proceed from here plus I have so many other issues to work out. If anyone has any ideas, I would appreciate them.

AjK’s picture

Status: Active » Postponed

I failed to reproduce this problem on my test setup. But the failure appears to be in the node core module somehow. But when I delete a pending invitation all happens as expected without error/warning messages.

I think this must have something to do with other installed modules. I tried it with Buddylist but still could not reproduce. Any further info (such as other modules installed) would be useful.

Changing to "postponed" to take it out of queue focus. If you are leaving more details as request, please change the status back to "active"

AjK’s picture

Status: Postponed » Closed (duplicate)

In fact, this is a duplicate (or other way round) of http://drupal.org/node/92847

That issue appears to point the finger at OG. Please continue if needed on that issue.