Problem/Motivation

There is a rare problem in the radioactivity_node.module call to hook_nodeapi associated with the recent feature addition that allows privileged users to edit a node's energy level. Normally, on a node form the energy values are stored in $node->radioactivity_node array, which is then parsed by a foreach loop (line 159) when the node is saved. However, if a module loads and saves a node, the $node->radioactivity_node is not present (as it is only added on the node forms) and the foreach loop throws an error as a result.

Proposed resolution

Because $node->radioactivity_node is intended to store user edits to node energy I propose adding a check for $node->radioactivity_node prior to running the foreach loop. Modules that need to edit a node's energy can take a different approach.

I have attached a patch with the proposed solution.

Comments

kevinchampion’s picture

I can confirm this bug and confirm that the patch resolves the error.

kevinchampion’s picture

Issue summary: View changes

silly grammer mistakes

sutharsan’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Issue triage: Closing issue, the 6.x branch is no longer maintained.

If you believe this issue is closed in error, feel free to re-open.