diff options
| author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-07 22:10:39 +0000 | 
|---|---|---|
| committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-07 22:10:39 +0000 | 
| commit | d924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (patch) | |
| tree | c98a3e8deb0c7fc8877dbcfe4ea20113ff49a507 /engine/classes/ElggEntity.php | |
| parent | e19c9f1ca4f6d8b3764a74de352705ba13650236 (diff) | |
| download | elgg-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/ElggEntity.php')
| -rw-r--r-- | engine/classes/ElggEntity.php | 7 | 
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');  		}  | 
