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

Aaron Hawkins - January 1, 2009 - 14:57
Priority:normal» critical

I changed this to critical because when this error occurs the whole site goes down.

#2

skiminki - January 3, 2009 - 09:30
Version:6.x-1.0-rc1» 6.x-1.0

Can you provide the actual error message related to the break? If I had to guess, we miss a require_once for 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

skiminki - January 4, 2009 - 20:04

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:

  • Can you provide more information on what you're doing? Do you call node_load() from the usual places, such as other modules or theme, or do you have some more exotic use case? (You mentioned some script...).
  • Can you test the attached patch against the latest development snapshot, and see if it fixes your problem? Please verify that the snapshot has date 2009-Jan-04 or newer. If not, wait a day or so. You can also checkout directly from CVS from DRUPAL-6--1 branch.
AttachmentSize
radioactivity-353163.patch 2.38 KB

#4

Aaron Hawkins - January 5, 2009 - 10:31

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

Aaron Hawkins - January 5, 2009 - 10:33
Status:needs review» closed
 
 

Drupal is a registered trademark of Dries Buytaert.