When editing an already existing own comment, and saving ones edits, the following error message is getting displayed at the top of page:
Notice: Undefined variable: original in commons_radioactivity_comment_update() (line 45 of [...]/profiles/commons/modules/contrib/commons_radioactivity/includes/incidents/commons_radioactivity.incidents_comment.inc).
Notice: Trying to get property of non-object in commons_radioactivity_comment_update() (line 45 of [...]/profiles/commons/modules/contrib/commons_radioactivity/includes/incidents/commons_radioactivity.incidents_comment.inc).
Experienced with: Drupal Commons 7.x-3.1+1-dev
This can be fixed by exchanging line 45 profiles/commons/modules/contrib/commons_radioactivity/includes/incidents/commons_radioactivity.incidents_comment.inc with this:
$comment_change = $comment->status + $comment->original->status;
Because that's the way how the original comment is saved within a comment object in Drupal 7 [source]. I have however not checked the logic behind calculating that sum, means I trust you folks that this is correct :)
Comments
Comment #1
stupiddingo commentedThis error also exists in Commons 7.x-3.2 and 7.x-3.x-dev
The solution tanius describes above works well. With this small fix, I'm not seeing anymore errors from comment editing, and works cleanly for all CRUD. Logic looks sound to me, and I suspect the $original->status was just a typo.
Patch attached for review.
Comment #2
stupiddingo commentedChanging status to "needs review" rather than just talking about it. Doh.
Comment #3
japerryLooks good to me!
Comment #4
devin carlson commentedTested #1 which still applies cleanly and fixes the error.
Comment #5
devin carlson commentedCommitted to Commons Radioactivity 7.x-3.x.
http://drupalcode.org/project/commons_radioactivity.git/commit/303e13d