radiactivity nodeapi breaks node_load function
Aaron Hawkins - January 1, 2009 - 14:31
| Project: | Radioactivity |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
This is a simple fix and doesn't really require a full patch since it is only changing one word on line 129 of the radioactivity_node.module page.
The line currently reads:
case 'load':
but it should be changed to
case 'view':
When left as 'load' the script tries to call the function radioactivity_get_radioactivity_array even when the load is only coming from an internal module making use of the node_load() function. The result is a fatal error in some situations.
I made the change on my site and from what I can tell radioactivity still works fine with the alteration.

#1
I changed this to critical because when this error occurs the whole site goes down.
#2
Can you provide the actual error message related to the break? If I had to guess, we miss a
require_oncefor radioactivity.inc in nodeapi/load, which is somehow provided in nodeapi/view. I'll look into this later this weekend, if I could retrace and fix this.#3
Ok, I looked into this and AFAICT this can happen only if radioactivity_node.module is loaded and radioactivity.module is not. However, this shouldn't happen in normal circumstances, as radioactivity_node has a dependency to radioactivity.
I'm not too eager to make the change suggested, because we really want to have the 'radioactivity' member returned in node_load, and not only in node_view.
Some questions:
#4
You know I think this was a fluke. I was having this error show up for several hours while I was working on something then the database started showing signs of corruption. Then all sorts of bizarre errors started popping up. I reinstalled from a backed up database and now the error is gone even with your original code. I apologize for the false alarm.
#5