I am trying to implement a node function for story nodes. It's not getting called, and I can't figure out why.

Here's what I've got so far:

function story_node_type($op,$info) {
   if ($op!="delete")
      return;
}

I set a breakpoint on the "if" statement, then deleted a story node through the standard "edit node" page. The breakpoint was never reached. I tried putting print_r's before the "if" to make sure the debugger was working right, but the print_r's were never reached either.

I first tried putting the hook function in a module I created for that purpose. (It is a pre-existing module, and its other functions are getting called when they should.) Later I tried moving the hook function to template.php. It didn't work either place.

Comments

orthoducks’s picture

I looked at the code and found the problem: the definition has changed completely in Drupal 6, but the documentation has not been updated.

The correct form can be seen in node_invoke, in node.module @ line 634.

shaneonabike’s picture

I didn't actually have any problems using hook_node_type :)