summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-09-30 20:37:55 -0400
committerwebchick <webchick@24967.no-reply.drupal.org>2012-09-30 20:37:55 -0400
commit13f16ae3423087824118e1e5c07f88396a85c8f7 (patch)
tree7a9678d7256d44fdcd4d5580a548ffca98aa7459 /modules/comment/comment.module
parentc3cba0532ba45692af5378d1b89e745ea0df3701 (diff)
downloadbrdo-13f16ae3423087824118e1e5c07f88396a85c8f7.tar.gz
brdo-13f16ae3423087824118e1e5c07f88396a85c8f7.tar.bz2
Issue #1154382 by Berdir, barraponto, acouch, swentel, LoMo, DamienMcKenna, chx: Fixed View mode no longer can be changed.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 0f2c15a90..80c23e810 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -992,6 +992,14 @@ function comment_build_content($comment, $node, $view_mode = 'full', $langcode =
// Remove previously built content, if exists.
$comment->content = array();
+ // Allow modules to change the view mode.
+ $context = array(
+ 'entity_type' => 'comment',
+ 'entity' => $comment,
+ 'langcode' => $langcode,
+ );
+ drupal_alter('entity_view_mode', $view_mode, $context);
+
// Build fields content.
field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode, $langcode);
entity_prepare_view('comment', array($comment->cid => $comment), $langcode);