I have a drush task which deletes user comments. When this task is run, I get the following error:

Wiping database...Missing argument 2 for activity_comments_comment_delete() activity_comments.module:63           [warning]
Missing argument 3 for activity_comments_comment_delete() activity_comments.module:63           [warning]
PHP Fatal error:  Cannot use object of type stdClass as array in /var/www/.../sites/all/modules/contrib/activity/activity_comments/activity_comments.module on line 64
Drush command terminated abnormally due to an unrecoverable error.                              [error]
Error: Cannot use object of type stdClass as array in
/var/www/sites/.../sites/all/modules/contrib/activity/activity_comments/activity_comments.module,
line 64

The comments are deleted because I call node_delete()

CommentFileSizeAuthor
#3 comment_delete-1409262-3.patch1.5 KBsaitanay

Comments

albertczyk’s picture

Yeah, same issue. It looks like the function activity_comments_comment_delete hasn't been updated for Drupal 7. I have to fix that for a customer and I'll post the patch shortly.

heine’s picture

Title: Deleting comments through drush throws an error » Deleting comments throws an error
saitanay’s picture

Status: Active » Needs review
StatusFileSize
new1.5 KB

The module has a helper function to build a form that is shown when the comment is delated via the activity page.

The function that builds the form is named as activity_comments_comment_delete.

But Drupal is interpreting it as hook_comment_delete as the function name matches the pattern module_name_hook_name().

So, renamed this function as activity_comments_comment_delete_form and thereby renamed the submit handler of this function also from activity_comments_comment_delete_submit to activity_comments_comment_delete_form_submit.

Attached Patch. Tested and looked to work fine. Needs review.

Tanay

kappaluppa’s picture

Issue summary: View changes

I'm still having this problem. Any progress on this patch?

_shy’s picture

Status: Needs review » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.