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()
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | comment_delete-1409262-3.patch | 1.5 KB | saitanay |
Comments
Comment #1
albertczyk commentedYeah, 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.
Comment #2
heine commented#1733818: Cannot delete any comment on site. marked duplicate
Comment #3
saitanay commentedThe 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
Comment #4
kappaluppa commentedI'm still having this problem. Any progress on this patch?
Comment #5
_shyD7 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!