Skip to content

Instantly share code, notes, and snippets.

@EclipseGc
Created December 26, 2013 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EclipseGc/8136435 to your computer and use it in GitHub Desktop.
Save EclipseGc/8136435 to your computer and use it in GitHub Desktop.
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index eab4d3e..8cd2602 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -12,72 +12,83 @@ function comment_token_info() {
$type = array(
'name' => t('Comments'),
'description' => t('Tokens for comments posted on the site.'),
- 'needs-data' => 'comment',
+ 'needs-data' => 'entity:comment',
);
// @todo Make this work per field. See http://drupal.org/node/2031903
$entity['comment-count'] = array(
'name' => t("Comment count"),
'description' => t("The number of comments posted on an entity."),
+ 'type' => 'integer',
);
$entity['comment-count-new'] = array(
'name' => t("New comment count"),
'description' => t("The number of comments posted on an entity since the reader last viewed it."),
+ 'type' => 'integer',
);
// Core comment tokens
$comment['cid'] = array(
'name' => t("Comment ID"),
'description' => t("The unique ID of the comment."),
+ 'type' => 'integer',
);
$comment['hostname'] = array(
'name' => t("IP Address"),
'description' => t("The IP address of the computer the comment was posted from."),
+ 'type' => 'string',
);
$comment['name'] = array(
'name' => t("Name"),
'description' => t("The name left by the comment author."),
+ 'type' => 'string',
);
$comment['mail'] = array(
'name' => t("Email address"),
'description' => t("The email address left by the comment author."),
+ 'type' => 'email',
);
$comment['homepage'] = array(
'name' => t("Home page"),
'description' => t("The home page URL left by the comment author."),
+ 'type' => 'uri',
);
$comment['title'] = array(
'name' => t("Title"),
'description' => t("The title of the comment."),
+ 'type' => 'string',
);
$comment['body'] = array(
'name' => t("Content"),
'description' => t("The formatted content of the comment itself."),
+ 'type' => 'string',
);
$comment['url'] = array(
'name' => t("URL"),
'description' => t("The URL of the comment."),
+ 'type' => 'uri',
);
$comment['edit-url'] = array(
'name' => t("Edit URL"),
'description' => t("The URL of the comment's edit page."),
+ 'type' => 'uri',
);
// Chained tokens for comments
$comment['created'] = array(
'name' => t("Date created"),
'description' => t("The date the comment was posted."),
- 'type' => 'date',
+ 'type' => 'timestamp',
);
$comment['changed'] = array(
'name' => t("Date changed"),
'description' => t("The date the comment was most recently updated."),
- 'type' => 'date',
+ 'type' => 'timestamp',
);
$comment['parent'] = array(
'name' => t("Parent"),
'description' => t("The comment's parent, if comment threading is active."),
- 'type' => 'comment',
+ 'type' => 'entity:comment',
);
$comment['entity'] = array(
'name' => t("Entity"),
@@ -89,12 +100,12 @@ function comment_token_info() {
$comment['node'] = array(
'name' => t("Node"),
'description' => t("DEPRECATED: The node the comment was posted to."),
- 'type' => 'node',
+ 'type' => 'entity:node',
);
$comment['author'] = array(
'name' => t("Author"),
'description' => t("The author of the comment, if they were logged in."),
- 'type' => 'user',
+ 'type' => 'entity:user',
);
return array(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment