There is a PHP error in abuse_coment() function that leads to a PHP fatal error. The $comment variable is used as an array while it is an stdClass object.

The attached patch fix this.

CommentFileSizeAuthor
#1 abuse_objasarray.patch563 bytesbluetegu
abuse.module.patch596 bytesclaudiu.cristea

Comments

bluetegu’s picture

StatusFileSize
new563 bytes

Hi Claudiu, I got this error too. However I think the root of the problem is a missing break statement. Per the api, hook_comment first parameter is an array when the op=update. Attached is a proposed patch. Feedback appreciated.

nancydru’s picture

Status: Needs review » Needs work

I have the patch from #1 applied and still get

Fatal error: Cannot use object of type stdClass as array in /mnt/target03/357371/www.momsteam.com/web/content/sites/all/modules/abuse/abuse.module on line 369
nancydru’s picture

Claudiu's original patch seems to solve this.

nancydru’s picture

Status: Needs work » Reviewed & tested by the community

I suspect that both patches are needed.

bluetegu’s picture

Hi Nancy,
Its great to get immediate feedback!
The received the error (warning) when I deleted a comment. Once I added a break statement the warning went away, and this is rather obvious from the code.
I tried to update a comment to see whether I can reproduce the error on update comment operation, without applying Claudiu's patch, and I didn't get any error or warning. I verified that indeed the abuse_comment function was called by printing to the screen. So bottom line, I can't reconstruct the problem you are having. I'm reluctant to apply Claudiu's patch without further understanding reasons/scenarios.
Best,
Bluetegu

nancydru’s picture

Claudiu's patch is pretty obvious to me. It changes array references to object references. Once I applied it, my problem went away immediately.