2

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).

1 Answer 1

1

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') { unset($implementations['comment']); } } 

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

1
  • 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. Commented Apr 4, 2012 at 13:32

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.