ajax_comments_preprocess_comment() calls a module_invoke_all('link') which causes all modules which have hooked into hook_link_alter to modify $links to lose their modifications.

You were calling this i believe because your ajax_comments_link_alter() was not working properly. The reason it is not working properly is that the call to drupal_alter('link') in ajax_comments_submit() neglects the inclusion of the $comment object which your link_alter checks for before rewriting the 'delete' link.

Attached is a patch that fixes both of these issues.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nibblebot’s picture

This bug also afflicts comment_bonus_api. I've created an issue for that here: #1042794: incomplete call to drupal_alter('link')

gregstout’s picture

I ran into the same problem and used the above code to fix it. Confirmed that it doesn't recalculate the $links again and all my hook_link_alter functions for the $links will not be overwritten.

It seems maybe the patch above is malformed, but here is the patch I created from the code I changed (which it exactly as the above patch).

qzmenko’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Issue is closed because 6.x version is unsupported. Feel free to open new issue for 7.x or 8.x versions of module.