I need to use the Commentsblock module, but it is turning out to be pretty buggy. I've got an issue in the queue with a patch for comments not displaying for anonymous users.

Now I've got a second issue posted about how paging is broken, but I'm stumped on how to fix it so wanted to see if anyone else had an idea.

Here is the issue: http://drupal.org/node/1513910

My question is: Is there a way to prevent the comment_node_view function from executing?

Or....should I be going about this an entirely different way (backup plan is to use Views to display comments in a block, but I can't think of a way to respect threading so would like to avoid that if possible).


You can implement hook_module_implements_alter() and stop the hook being run for the comment module:

function MYMODULE_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'node_view') {

Once you clear the cache comment_node_view() won't be called any more.

  • Ah-mazing! Thanks, Clive. I hadn't seen that hook before but it did the trick perfectly. Going to add a patch to the issue queue with it in place. Apr 4 '12 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.