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.
// 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);
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | similarterms-new_hook-413184-3.patch | 1.94 KB | Mark Theunissen |
| #1 | similarterms-new_hook-413184-1.patch | 1.85 KB | Mark Theunissen |
Comments
Comment #1
Mark Theunissen commentedNote this patch also includes my critical bug report http://drupal.org/node/408262
Comment #2
Mark Theunissen commentedHang 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.
Comment #3
Mark Theunissen commentedHere's another go.
Comment #4
rmiddle commentedCommitted and will be in the next release.
Thanks
Robert