diff options
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 429c3b01b..05bc7aa2b 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -152,7 +152,7 @@ function comment_node_type_load($name) { } /** - * Entity uri callback. + * Entity URI callback. */ function comment_uri($comment) { return array( @@ -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); @@ -2375,7 +2383,6 @@ function theme_comment_post_forbidden($variables) { * Process variables for comment-wrapper.tpl.php. * * @see comment-wrapper.tpl.php - * @see theme_comment_wrapper() */ function template_preprocess_comment_wrapper(&$variables) { // Provide contextual information. |