With the replacement of hook_nodeapi() with hook_nodeapi_*(), we ended up with a bunch of one-line function hooks that just called another function. It would be best if we removed those function calls and just used the hook instead.
/**
* Implementation of hook_nodeapi_delete().
*/
function taxonomy_nodeapi_delete($node) {
taxonomy_node_delete($node);
}
/**
* Implementation of hook_nodeapi_delete_revision().
*/
function taxonomy_nodeapi_delete_revision($node) {
taxonomy_node_delete_revision($node);
}
/**
* Implementation of hook_nodeapi_validate().
*/
function taxonomy_nodeapi_validate($node, $form) {
taxonomy_node_validate($node);
}
/**
* Implementation of hook_nodeapi_rss_item().
*/
function taxonomy_nodeapi_rss_item($node) {
return taxonomy_rss_item($node);
}
/**
* Implementation of hook_nodeapi_update_index().
*/
function taxonomy_nodeapi_update_index($node) {
return taxonomy_node_update_index($node);
}
?>
..... etc.
Remove taxonomy_nodeapi_update_index, rename taxonomy_node_update_index to taxonomy_nodeapi_update_index. Also applies to the Trigger module.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 344361.patch | 5.54 KB | robloach |
| #5 | drupal_unnecessary_wrappers.patch | 4.42 KB | recidive |
| #3 | drupal_unnecessary_wrappers.patch | 4.2 KB | recidive |
Comments
Comment #1
robloachWaiting until #319356: Update hook_nodeapi_* functions signatures and documentation is in.
Comment #2
recidive commented#319356 is in.
Changing status to active.
Comment #3
recidive commentedHere is a patch.
Comment #5
recidive commentedOne of the functions was being called directly elsewhere.
All tests should pass now.
Comment #6
recidive commentedComment #7
robloachI had a look at the Trigger module, and it doesn't really look like we can do much there since we seem to do so much. Who's maintaining the Trigger module? It's broken....
Anyway, here's the patch with the removal of the $op check because we're explicitly calling it from the correct hooks so we know $op is valid.
Comment #8
recidive commented@Rob Loach: sorry, but how do your changes relates with the scope of this issue?
Comment #9
catchrecidive - trigger.module was part of the de-op of nodeapi, and it's also got lots of one line function calls inside nodeapi, but they're harder to factor out - but we can at least remove some cruft, which seems very much in scope here.
Comment #10
recidive commented@catch: thanks for the clarification. This makes sense.
Changing title to a more generic one.
Comment #11
dries commentedCommitted to CVS HEAD. Thanks!