Posted by claudiu.cristea on December 15, 2008 at 6:05pm
| Project: | abuse |
| Version: | 5.x-1.0-beta |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | claudiu.cristea |
| Status: | reviewed & tested by the community |
Issue Summary
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.
| Attachment | Size |
|---|---|
| abuse.module.patch | 596 bytes |
Comments
#1
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.
#2
I have the patch from #1 applied and still get
#3
Claudiu's original patch seems to solve this.
#4
I suspect that both patches are needed.
#5
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
#6
Claudiu's patch is pretty obvious to me. It changes array references to object references. Once I applied it, my problem went away immediately.