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

the greenman’s picture

I am also not entirely sure what is gained by not calling module_invoke_all here.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Fixed

Committed 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. ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.