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);

Comments

Mark Theunissen’s picture

StatusFileSize
new1.85 KB

Note this patch also includes my critical bug report http://drupal.org/node/408262

Mark Theunissen’s picture

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.

Mark Theunissen’s picture

StatusFileSize
new1.94 KB

Here's another go.

rmiddle’s picture

Status: Needs review » Fixed

Committed and will be in the next release.

Thanks
Robert

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.