Posted by Mark Theunissen on March 25, 2009 at 10:58am
| Project: | Similar By Terms |
| Version: | 6.x-1.18 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Mark Theunissen |
| Status: | closed (fixed) |
Issue Summary
I propose that the nodes array should be passed to a hook so that other modules can modify it. This arises from my need to modify the list in a way that is too customised to warrant making specific admin options.
The following code should do it. Patch attached.
<?php
// Allow modules to alter the list of nodes by implementing a hook.
// TODO: Pass by reference the $nodes array rather than returning them.
$nodes = module_invoke_all('similarterms_alter', $node_obj, $nodes);
?>
Comments
#1
Note this patch also includes my critical bug report http://drupal.org/node/408262
#2
Hang on, I just realised this doesn't work properly in cases where a hook is not implemented. I'll have to implement the pass by reference to have it behave.
#3
Here's another go.
#4
Committed and will be in the next release.
Thanks
Robert
#5
Automatically closed -- issue fixed for 2 weeks with no activity.