aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:10:39 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:10:39 +0000
commitd924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (patch)
treec98a3e8deb0c7fc8877dbcfe4ea20113ff49a507 /engine/classes
parente19c9f1ca4f6d8b3764a74de352705ba13650236 (diff)
downloadelgg-d924a462f39ff922a4cc9f6635cfe5d0c0f14db3.tar.gz
elgg-d924a462f39ff922a4cc9f6635cfe5d0c0f14db3.tar.bz2
Refs #3510, #3433. Ported r9062 to trunk. Fix for comment hook returning 0 comments.
git-svn-id: http://code.elgg.org/elgg/trunk@9139 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggEntity.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 79b8c2a4e..8fc1e46cb 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -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');
}