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

AttachmentSize
similarterms-new_hook-413184-1.patch 1.85 KB

#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.

AttachmentSize
similarterms-new_hook-413184-3.patch 1.94 KB

#4

Status:needs review» fixed

Committed and will be in the next release.

Thanks
Robert

#5

Status:fixed» closed (fixed)

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