Permalink
Browse files

fix(comments): allow comments hook to return empty strings

Falsy values returned by hook handlers for comments result
in default form being displayed. This checks to see if the
false value passed as default to the hook has been altered,
and only displays the default comments form if not.
  • Loading branch information...
hypeJunction committed Apr 15, 2015
1 parent d49269f commit 37321a14fa3106d7a8474750948fe2bc16482dcc
Showing with 1 addition and 1 deletion.
  1. +1 −1 engine/lib/views.php
View
@@ -1163,7 +1163,7 @@ function elgg_view_comments($entity, $add_comment = true, array $vars = array())
$vars['class'] = elgg_extract('class', $vars, "{$entity->getSubtype()}-comments");
$output = elgg_trigger_plugin_hook('comments', $entity->getType(), $vars, false);
- if ($output) {
+ if ($output !== false) {
return $output;
} else {
return elgg_view('page/elements/comments', $vars);

0 comments on commit 37321a1

Please sign in to comment.