Even when non-admins have the permission to delete their own comments, when they try it throws an error. I've created a video for it here:

non-admin can't delete own comments

thanks for looking into this

Comments

hedley’s picture

I've run into this issue as well, it seems to be being caused by the dynamic query in _heartbeat_comments_delete_access().

The fetchField() apparently only accepts numeric indicies which could be something to do with it (http://drupal.org/node/310075#executing_the_query) - removing the 'uid' seems to get it working. Or alternatively a static query can be used. Patches for both dynamic and static queries attached.

hedley’s picture

Something else to note is that deleting comments with Javascript disabled currently throws an error

KorbenDallas’s picture

Do you recommend we use one patched method over the other? In other words, are there trade-offs?

hedley’s picture

Status: Active » Needs review

Good question! I wasn't sure so went with both, but after reading this: http://drupal.org/node/835068 I think the dynamic query is the best one to use: 'heartbeat-commentdeletedynamic-1554974-2.patch'

KorbenDallas’s picture

Tested OK for me. Reading this: fetchField, the dynamic query originally should had a 0 in it instead of 'uid'. By removing 'uid' as done the dynamic patch, fetchField is defaulting to the first field in the query, which is the same as putting a 0 in there.

I'm going to use the dynamic patch. Thanks hedley

Stalski’s picture

Status: Needs review » Fixed

What you said in #1 is correct. The dynamic patch is committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

suparnanr1’s picture

I have followed the above instruction(I have applied the heartbeat-commentdeletedynamic-1554974-2.patch) but then also same error is coming when a non-admin deletes their own comment...

Please if possible, fix it...

Thanks in advance...