aboutsummaryrefslogtreecommitdiff
path: root/views/default/page/elements/comments_block.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/page/elements/comments_block.php')
-rw-r--r--views/default/page/elements/comments_block.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/views/default/page/elements/comments_block.php b/views/default/page/elements/comments_block.php
index 89e43b266..d0f8ab809 100644
--- a/views/default/page/elements/comments_block.php
+++ b/views/default/page/elements/comments_block.php
@@ -2,16 +2,27 @@
/**
* Display the latest related comments
*
- * Generally used in a sidebar
+ * Generally used in a sidebar. Does not work with groups currently.
*
* @uses $vars['subtypes'] Object subtype string or array of subtypes
* @uses $vars['owner_guid'] The owner of the content being commented on
* @uses $vars['limit'] The number of comments to display
*/
+$owner_guid = elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE);
+if (!$owner_guid) {
+ $owner_guid = ELGG_ENTITIES_ANY_VALUE;
+}
+
+$owner_entity = get_entity($owner_guid);
+if ($owner_entity && elgg_instanceof($owner_entity, 'group')) {
+ // not supporting groups so return
+ return true;
+}
+
$options = array(
'annotation_name' => 'generic_comment',
- 'owner_guid' => elgg_extract('owner_guid', $vars, ELGG_ENTITIES_ANY_VALUE),
+ 'owner_guid' => $owner_guid,
'reverse_order_by' => true,
'limit' => elgg_extract('limit', $vars, 4),
'type' => 'object',
@@ -25,6 +36,7 @@ if ($comments) {
'items' => $comments,
'pagination' => false,
'list_class' => 'elgg-latest-comments',
+ 'full_view' => false,
));
} else {
$body = '<p>' . elgg_echo('generic_comment:none') . '</p>';