Needs review
Project:
RelatedContent
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2010 at 21:58 UTC
Updated:
23 Jan 2013 at 21:15 UTC
Jump to comment: Most recent file
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).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | relatedcontent-731878-relatedcontent_get_nodes_function_error-3.patch | 1015 bytes | dooug |
| #1 | relatedcontent_731878_api_improvement_1.patch | 757 bytes | dooug |
Comments
Comment #1
dooug commentedOops! Forgot to attach the patch. It patches the 6.x-1.x-dev version
Comment #2
dooug commentedComment #3
dooug commented(revisiting my old issues)
Re-rolled this patch properly. It seems to still be a valid improvement to the function
relatedcontent_get_nodes().