diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-06-29 00:57:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-06-29 00:57:19 +0000 |
commit | b6c0d1ab208af3cd16316324f54d2e10875b5286 (patch) | |
tree | f569d6bf46c680a867e5c838b91be00659a32265 | |
parent | cbfdd2e9c7bc67f374ecb434369111d630399fea (diff) | |
download | brdo-b6c0d1ab208af3cd16316324f54d2e10875b5286.tar.gz brdo-b6c0d1ab208af3cd16316324f54d2e10875b5286.tar.bz2 |
- Patch #831914 by Dave Reid: removed redundant/duplicate [node:uid], [comment:uid], and [file:uid] tokens.
-rw-r--r-- | modules/comment/comment.test | 6 | ||||
-rw-r--r-- | modules/comment/comment.tokens.inc | 24 | ||||
-rw-r--r-- | modules/file/tests/file.test | 3 | ||||
-rw-r--r-- | modules/node/node.test | 2 | ||||
-rw-r--r-- | modules/node/node.tokens.inc | 8 | ||||
-rw-r--r-- | modules/system/system.tokens.inc | 8 |
6 files changed, 5 insertions, 46 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test index 03cc74ba7..ae680cecd 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -1187,9 +1187,6 @@ class CommentTokenReplaceTestCase extends CommentHelperCase { // Generate and test sanitized tokens. $tests = array(); $tests['[comment:cid]'] = $comment->cid; - $tests['[comment:pid]'] = $comment->pid; - $tests['[comment:nid]'] = $comment->nid; - $tests['[comment:uid]'] = $comment->uid; $tests['[comment:hostname]'] = check_plain($comment->hostname); $tests['[comment:name]'] = filter_xss($comment->name); $tests['[comment:mail]'] = check_plain($this->admin_user->mail); @@ -1200,8 +1197,11 @@ class CommentTokenReplaceTestCase extends CommentHelperCase { $tests['[comment:edit-url]'] = url('comment/' . $comment->cid . '/edit', $url_options); $tests['[comment:created:since]'] = format_interval(REQUEST_TIME - $comment->created, 2, $language->language); $tests['[comment:changed:since]'] = format_interval(REQUEST_TIME - $comment->changed, 2, $language->language); + $tests['[comment:parent:cid]'] = $comment->pid; $tests['[comment:parent:title]'] = check_plain($parent_comment->subject); + $tests['[comment:node:nid]'] = $comment->nid; $tests['[comment:node:title]'] = check_plain($node->title); + $tests['[comment:author:uid]'] = $comment->uid; $tests['[comment:author:name]'] = check_plain($this->admin_user->name); // Test to make sure that we generated something for each token. diff --git a/modules/comment/comment.tokens.inc b/modules/comment/comment.tokens.inc index cf26d74c9..3f233733d 100644 --- a/modules/comment/comment.tokens.inc +++ b/modules/comment/comment.tokens.inc @@ -31,18 +31,6 @@ function comment_token_info() { 'name' => t("Comment ID"), 'description' => t("The unique ID of the comment."), ); - $comment['pid'] = array( - 'name' => t("Parent ID"), - 'description' => t("The unique ID of the comment's parent, if comment threading is active."), - ); - $comment['nid'] = array( - 'name' => t("Node ID"), - 'description' => t("The unique ID of the node the comment was posted to."), - ); - $comment['uid'] = array( - 'name' => t("User ID"), - 'description' => t("The unique ID of the user who posted the comment."), - ); $comment['hostname'] = array( 'name' => t("IP Address"), 'description' => t("The IP address of the computer the comment was posted from."), @@ -138,18 +126,6 @@ function comment_tokens($type, $tokens, array $data = array(), array $options = $replacements[$original] = $comment->cid; break; - case 'pid': - $replacements[$original] = $comment->pid; - break; - - case 'nid': - $replacements[$original] = $comment->nid; - break; - - case 'uid': - $replacements[$original] = $comment->uid; - break; - // Poster identity information for comments case 'hostname': $replacements[$original] = $sanitize ? check_plain($comment->hostname) : $comment->hostname; diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test index bbf48a742..562db0ae0 100644 --- a/modules/file/tests/file.test +++ b/modules/file/tests/file.test @@ -647,7 +647,6 @@ class FileTokenReplaceTestCase extends FileFieldTestCase { // Generate and test sanitized tokens. $tests = array(); $tests['[file:fid]'] = $file->fid; - $tests['[file:uid]'] = $file->uid; $tests['[file:name]'] = check_plain($file->filename); $tests['[file:description]'] = filter_xss($file->description); $tests['[file:path]'] = filter_xss($file->uri); @@ -657,7 +656,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase { $tests['[file:timestamp]'] = format_date($file->timestamp, 'medium', '', NULL, $language->language); $tests['[file:timestamp:short]'] = format_date($file->timestamp, 'short', '', NULL, $language->language); $tests['[file:owner]'] = $this->admin_user->name; - $tests['[file:owner:uid]'] = $this->admin_user->uid; + $tests['[file:owner:uid]'] = $file->uid; // Test to make sure that we generated something for each token. $this->assertFalse(in_array(0, array_map('strlen', $tests)), t('No empty tokens generated.')); diff --git a/modules/node/node.test b/modules/node/node.test index 629509c7a..7369b8699 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1730,7 +1730,6 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase { $tests['[node:nid]'] = $node->nid; $tests['[node:vid]'] = $node->vid; $tests['[node:tnid]'] = $node->tnid; - $tests['[node:uid]'] = $node->uid; $tests['[node:type]'] = 'article'; $tests['[node:type-name]'] = 'Article'; $tests['[node:title]'] = check_plain($node->title); @@ -1739,6 +1738,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase { $tests['[node:language]'] = check_plain($node->language); $tests['[node:url]'] = url('node/' . $node->nid, $url_options); $tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options); + $tests['[node:author:uid]'] = $node->uid; $tests['[node:author:name]'] = check_plain($account->name); $tests['[node:created:since]'] = format_interval(REQUEST_TIME - $node->created, 2, $language->language); $tests['[node:changed:since]'] = format_interval(REQUEST_TIME - $node->changed, 2, $language->language); diff --git a/modules/node/node.tokens.inc b/modules/node/node.tokens.inc index c28e5347e..be064ab29 100644 --- a/modules/node/node.tokens.inc +++ b/modules/node/node.tokens.inc @@ -31,10 +31,6 @@ function node_token_info() { 'name' => t("Translation set ID"), 'description' => t("The unique ID of the original-language version of this node, if one exists."), ); - $node['uid'] = array( - 'name' => t("User ID"), - 'description' => t("The unique ID of the user who posted the node."), - ); $node['type'] = array( 'name' => t("Content type"), 'description' => t("The type of the node."), @@ -125,10 +121,6 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr $replacements[$original] = $node->tnid; break; - case 'uid': - $replacements[$original] = $node->uid; - break; - case 'type': $replacements[$original] = $sanitize ? check_plain($node->type) : $node->type; break; diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index 501ab8fd5..39c326f0e 100644 --- a/modules/system/system.tokens.inc +++ b/modules/system/system.tokens.inc @@ -89,10 +89,6 @@ function system_token_info() { 'name' => t("File ID"), 'description' => t("The unique ID of the uploaded file."), ); - $file['uid'] = array( - 'name' => t("User ID"), - 'description' => t("The unique ID of the user who owns the file."), - ); $file['name'] = array( 'name' => t("File name"), 'description' => t("The name of the file on disk."), @@ -237,10 +233,6 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a $replacements[$original] = $file->fid; break; - case 'uid': - $replacements[$original] = $file->uid; - break; - // Essential file data case 'name': $replacements[$original] = $sanitize ? check_plain($file->filename) : $file->filename; |