]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #3510, #3433. Ported r9062 to trunk. Fix for comment hook returning 0 comments.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 7 Jun 2011 22:10:39 +0000 (22:10 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 7 Jun 2011 22:10:39 +0000 (22:10 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9139 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php

index 79b8c2a4e3564d25f1cffedb0ab7ca02e05d7afe..8fc1e46cb07d55079a0fd74d9c9b01014350bb45 100644 (file)
@@ -850,12 +850,11 @@ abstract class ElggEntity extends ElggData implements
         * @since 1.8.0
         */
        function countComments() {
-               $type = $this->getType();
                $params = array('entity' => $this);
-               $number = elgg_trigger_plugin_hook('comments:count', $type, $params, false);
+               $num = trigger_plugin_hook('comments:count', $this->getType(), $params);
 
-               if ($number) {
-                       return $number;
+               if (is_int($num)) {
+                       return $num;
                } else {
                        return $this->getAnnotationCalculation('generic_comment', 'count');
                }