neither http://api.drupal.org/api/4.6/function/hook_nodeapi nor http://api.drupal.org/api/head/function/hook_nodeapi make any reference to a 'delete pre' op in nodeapi. in testing, i've created a couple of signup-enabled nodes, tried deleting them, and have never seen anything that hits this code block:

    case 'delete pre':

      //if the node has any signups, prevent deletion and warn
      if (variable_get('signup_form_' . $node->type, FALSE) && ($user_signups = db_num_rows(db_query('SELECT
        nid FROM {signup_log} WHERE nid = %d', $node->nid)))) {

        $form['signup'] = array('#type' => 'markup', '#value' => t('WARNING: %d user(s) signed up for %title.  Deleting this event will delete all signups associated with it!', array('%title'=>$node->title, '%d'=>$user_signups)));
        $form['foo'] = array('#type' => 'textfield', '#title' => 'foo');
        return $form;
      }
      break;

(signup.module ~ line 334)

is this just dead code? if so, we should remove it (and/or potentially port it to the proper way to intercept a delete attempt, if we want to retain this functionality). good thing we're not hitting this code: note the XSS bug in how we're displaying the title here. ;) it's also the one instance of the (s) vs. format_plural stuff i didn't fix yet (see http://drupal.org/node/61971). my preference would be to just delete this code entirely.

Comments

hunmonk’s picture

Status: Active » Closed (works as designed)

please leave this code in the HEAD version of the module. it's put there in anticipation of the forthcoming 'delete pre' nodeapi operation. removing it from the 4.7 version of the module would be a good idea, though...

dww’s picture

Status: Closed (works as designed) » Fixed

great. i removed the code entirely from 4.7.0 (revision 1.45.2.3). in HEAD, i closed the XSS hole, fixed the format_plural() thing, removed a line of debugging code that was lurking in there, and fixed up some formatting (revision 1.49). this issue is hereby resolved. ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)