From 83c97345e8eada544d7da4586e2c77db469ed5b1 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 13 Jan 2010 06:26:49 +0000 Subject: #525622 by Frando, yched, et al: Add entity hook callbacks so that 'as link' formatters have a generic way to build the url of an 'entity'. --- modules/comment/comment.module | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 678c92bf2..0b3fc2d8c 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -97,6 +97,7 @@ function comment_entity_info() { 'comment' => array( 'label' => t('Comment'), 'base table' => 'comment', + 'path callback' => 'comment_path', 'fieldable' => TRUE, 'controller class' => 'CommentController', 'object keys' => array( @@ -125,6 +126,13 @@ function comment_entity_info() { return $return; } +/** + * Entity path callback. + */ +function comment_path($comment) { + return 'comment/' . $comment->cid; +} + /** * Implements hook_theme(). */ -- cgit v1.2.3