I was using the relatedcontent_get_nodes() function and was getting the error when the function was passed a node that had no relatedcontent nodes.

warning: asort() expects parameter 1 to be array, null given in /Library/WebServer/Documents/staff-6.15/sites/all/modules/relatedcontent/relatedcontent.module on line 63.

I've made minor improvements to the relatedcontent_get_nodes() function and attached a patch. The improved code ensures that even if there are no relatedcontent nodes an empty array will be returned (instead of NULL).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dooug’s picture

Oops! Forgot to attach the patch. It patches the 6.x-1.x-dev version

dooug’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
dooug’s picture

Category: feature » task
FileSize
1015 bytes

(revisiting my old issues)

Re-rolled this patch properly. It seems to still be a valid improvement to the function relatedcontent_get_nodes().