Closed (fixed)
Project:
Signup
Version:
5.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
5 Jan 2007 at 18:13 UTC
Updated:
26 Dec 2007 at 07:41 UTC
The user id of the user to cancel the signup for needs to be passed to the various functions for this to be properly useful.
function signup_cancel_signup($uid, $nid, $anon_mail = NULL) {
//delete the selected user from the log table and return to the previous page
if ($anon_mail) {
db_query("DELETE FROM {signup_log} WHERE anon_mail = '%s'", $anon_mail);
} else {
db_query('DELETE FROM {signup_log} WHERE uid = %d AND nid = %d', $uid, $nid);
}
$node = node_load($nid);
foreach (module_implements('signup_cancel') as $module) {
$function = $module .'_signup_cancel';
$function($node);
}
drupal_set_message(t('Signup to %title cancelled.', array('%title' => l($node->title, "node/$node->nid"))));
}
Comments
Comment #1
the greenman commentedI am also not entirely sure what is gained by not calling module_invoke_all here.
Comment #2
dwwCommitted a fix to HEAD, DRUPAL-5 and DRUPAL-4-7. Yes, the $uid argument is clearly necessary if this hook is actually useful for anything. ;)
Furthermore, module_invoke_all() works here. If you want the hook to be able to take a variable by reference, you have to do it manually like the code used to. However, in this case, the hook is purely advisory, so module_invoke_all() is safe.
Thanks for the report, and sorry for the huge delay actually committing a fix. ;)
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.