summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 06:17:29 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-05 06:17:29 +0000
commit5d76008993fc7edc5d4c1aedba8af81b36d1554e (patch)
treeb3d5b4ec8d296f326330d1eb5bef31af66821fd9
parente4c0766ca4cb88cf742989f924f414de354f69cb (diff)
downloadbrdo-5d76008993fc7edc5d4c1aedba8af81b36d1554e.tar.gz
brdo-5d76008993fc7edc5d4c1aedba8af81b36d1554e.tar.bz2
#438224 by dww, sun, netsensei, vordude, et al: 'Post comments without approval' permission name is completely misleading.
-rw-r--r--modules/comment/comment.module16
-rw-r--r--modules/comment/comment.test12
-rw-r--r--modules/rdf/rdf.test4
-rw-r--r--modules/search/search.test10
-rw-r--r--modules/simpletest/drupal_web_test_case.php2
-rw-r--r--modules/tracker/tracker.test2
-rw-r--r--modules/trigger/trigger.test8
-rw-r--r--modules/user/user.install14
-rw-r--r--modules/user/user.test2
-rw-r--r--profiles/standard/standard.install2
10 files changed, 43 insertions, 29 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 10df685fe..6a3cc884b 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -82,8 +82,8 @@ function comment_help($path, $arg) {
$output .= '<dl>';
$output .= '<dt>' . t('Default and custom settings') . '</dt>';
$output .= '<dd>' . t("Each <a href='@content-type'>content type</a> can have its own default comment settings configured as: <em>Open</em> to allow new comments, <em>Hidden</em> to hide existing comments and prevent new comments, or <em>Closed</em> to view existing comments, but prevent new comments. These defaults will apply to all new content created (changes to the settings on existing content must be done manually). Other comment settings can also be customized per content type, and can be overridden for any given item of content. When a comment has no replies, it remains editable by its author, as long as the author has a user account and is logged in.", array('@content-type' => url('admin/structure/types'))) . '</dd>';
- $output .= '<dt>' . t('Comment moderation') . '</dt>';
- $output .= '<dd>' . t("Comments from users who do not have the <em>Post comments without approval</em> permission are placed in the <a href='@comment-approval'>Unapproved comments</a> queue, until a user who has permission to <em>Administer comments</em> moderates them as either published or deleted. Published comments can be bulk managed on the <a href='@admin-comment'>Published comments</a> administration page.", array('@comment-approval' => url('admin/content/comment/approval'), '@admin-comment' => url('admin/content/comment'))) . '</dd>';
+ $output .= '<dt>' . t('Comment approval') . '</dt>';
+ $output .= '<dd>' . t("Comments from users who have the <em>Skip comment approval</em> permission are published immediately. All other comments are placed in the <a href='@comment-approval'>Unapproved comments</a> queue, until a user who has permission to <em>Administer comments</em> publishes or deletes them. Published comments can be bulk managed on the <a href='@admin-comment'>Published comments</a> administration page.", array('@comment-approval' => url('admin/content/comment/approval'), '@admin-comment' => url('admin/content/comment'))) . '</dd>';
$output .= '</dl>';
return $output;
}
@@ -386,10 +386,10 @@ function comment_permission() {
'title' => t('View comments'),
),
'post comments' => array(
- 'title' => t('Post comments with approval'),
+ 'title' => t('Post comments'),
),
- 'post comments without approval' => array(
- 'title' => t('Post comments without approval'),
+ 'skip comment approval' => array(
+ 'title' => t('Skip comment approval'),
),
'edit own comments' => array(
'title' => t('Edit own comments'),
@@ -1421,7 +1421,7 @@ function comment_save($comment) {
'mail' => '',
'homepage' => '',
'name' => '',
- 'status' => user_access('post comments without approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED,
+ 'status' => user_access('skip comment approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED,
);
foreach ($defaults as $key => $default) {
if (!isset($comment->$key)) {
@@ -1867,7 +1867,7 @@ function comment_form($form, &$form_state, $comment) {
else {
$author = ($comment->name ? $comment->name : variable_get('anonymous', t('Anonymous')));
}
- $status = (user_access('post comments without approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED);
+ $status = (user_access('skip comment approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED);
$date = '';
}
@@ -2282,7 +2282,7 @@ function theme_comment_post_forbidden($variables) {
if (!isset($authenticated_post_comments)) {
// We only output a link if we are certain that users will get permission
// to post comments by logging in.
- $authenticated_post_comments = array_key_exists(DRUPAL_AUTHENTICATED_RID, user_roles(TRUE, 'post comments') + user_roles(TRUE, 'post comments without approval'));
+ $authenticated_post_comments = array_key_exists(DRUPAL_AUTHENTICATED_RID, user_roles(TRUE, 'post comments') + user_roles(TRUE, 'skip comment approval'));
}
if ($authenticated_post_comments) {
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 2515a9693..57af9e562 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -440,7 +440,7 @@ class CommentPreviewTest extends CommentHelperCase {
*/
function testCommentEditPreview() {
$langcode = LANGUAGE_NONE;
- $web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'post comments without approval'));
+ $web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'skip comment approval'));
$this->drupalLogin($this->admin_user);
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
@@ -495,7 +495,7 @@ class CommentAnonymous extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => TRUE,
'post comments' => TRUE,
- 'post comments without approval' => TRUE,
+ 'skip comment approval' => TRUE,
));
$this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
$this->drupalLogout();
@@ -579,7 +579,7 @@ class CommentAnonymous extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => FALSE,
'post comments' => FALSE,
- 'post comments without approval' => FALSE,
+ 'skip comment approval' => FALSE,
));
// Attempt to view comments while disallowed.
@@ -598,7 +598,7 @@ class CommentAnonymous extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => TRUE,
'post comments' => FALSE,
- 'post comments without approval' => FALSE,
+ 'skip comment approval' => FALSE,
));
$this->drupalGet('node/' . $this->node->nid);
$this->assertPattern('/<div ([^>]*?)id="comments"([^>]*?)>/', t('Comments were displayed.'));
@@ -890,7 +890,7 @@ class CommentApprovalTest extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => TRUE,
'post comments' => TRUE,
- 'post comments without approval' => FALSE,
+ 'skip comment approval' => FALSE,
));
$this->drupalLogin($this->admin_user);
$this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
@@ -959,7 +959,7 @@ class CommentApprovalTest extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => TRUE,
'post comments' => TRUE,
- 'post comments without approval' => FALSE,
+ 'skip comment approval' => FALSE,
));
$this->drupalLogin($this->admin_user);
$this->setCommentAnonymous('0'); // Ensure that doesn't require contact info.
diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test
index e3287a511..4cab590ac 100644
--- a/modules/rdf/rdf.test
+++ b/modules/rdf/rdf.test
@@ -411,7 +411,7 @@ class RdfCommentAttributesTestCase extends CommentHelperCase {
user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array(
'access comments' => TRUE,
'post comments' => TRUE,
- 'post comments without approval' => TRUE,
+ 'skip comment approval' => TRUE,
));
// Allows anonymous to leave their contact information.
$this->setCommentAnonymous(COMMENT_ANONYMOUS_MAY_CONTACT);
@@ -569,7 +569,7 @@ class RdfTrackerAttributesTestCase extends DrupalWebTestCase {
'create article content' => TRUE,
'access comments' => TRUE,
'post comments' => TRUE,
- 'post comments without approval' => TRUE,
+ 'skip comment approval' => TRUE,
));
}
diff --git a/modules/search/search.test b/modules/search/search.test
index 29fa9ef3f..f0d3a6a4b 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -363,7 +363,7 @@ class SearchRankingTestCase extends DrupalWebTestCase {
function testRankings() {
// Login with sufficient privileges.
- $this->drupalLogin($this->drupalCreateUser(array('post comments without approval', 'create page content')));
+ $this->drupalLogin($this->drupalCreateUser(array('skip comment approval', 'create page content')));
// Build a list of the rankings to test.
$node_ranks = array('sticky', 'promote', 'relevance', 'recent', 'comments', 'views');
@@ -518,7 +518,7 @@ class SearchRankingTestCase extends DrupalWebTestCase {
*/
function testDoubleRankings() {
// Login with sufficient privileges.
- $this->drupalLogin($this->drupalCreateUser(array('post comments without approval', 'create page content')));
+ $this->drupalLogin($this->drupalCreateUser(array('skip comment approval', 'create page content')));
// See testRankings() above - build a node that will rank high for sticky.
$settings = array(
@@ -695,7 +695,7 @@ class SearchCommentTestCase extends DrupalWebTestCase {
filter_permission_name($full_html_format),
'administer permissions',
'create page content',
- 'post comments without approval',
+ 'skip comment approval',
'access comments',
);
$this->admin_user = $this->drupalCreateUser($permissions);
@@ -949,7 +949,7 @@ class SearchCommentCountToggleTestCase extends DrupalWebTestCase {
parent::setUp('search');
// Create searching user.
- $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'post comments without approval'));
+ $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval'));
// Create initial nodes.
$node_params = array('type' => 'article', 'body' => array(LANGUAGE_NONE => array(array('value' => 'SearchCommentToggleTestCase'))));
@@ -1082,7 +1082,7 @@ class SearchKeywordsConditions extends DrupalWebTestCase {
function setUp() {
parent::setUp('search', 'search_extra_type');
// Create searching user.
- $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'post comments without approval'));
+ $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval'));
// Login with sufficient privileges.
$this->drupalLogin($this->searching_user);
// Test with all search modules enabled.
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index a8692464b..997eaaba1 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -991,7 +991,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* A fully loaded user object with pass_raw property, or FALSE if account
* creation fails.
*/
- protected function drupalCreateUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) {
+ protected function drupalCreateUser($permissions = array('access comments', 'access content', 'post comments', 'skip comment approval')) {
// Create a role with the given permission set.
if (!($rid = $this->drupalCreateRole($permissions))) {
return FALSE;
diff --git a/modules/tracker/tracker.test b/modules/tracker/tracker.test
index 12dc9d48d..c0233085c 100644
--- a/modules/tracker/tracker.test
+++ b/modules/tracker/tracker.test
@@ -17,7 +17,7 @@ class TrackerTest extends DrupalWebTestCase {
function setUp() {
parent::setUp('comment', 'tracker');
- $permissions = array('access comments', 'create page content', 'post comments', 'post comments without approval');
+ $permissions = array('access comments', 'create page content', 'post comments', 'skip comment approval');
$this->user = $this->drupalCreateUser($permissions);
$this->other_user = $this->drupalCreateUser($permissions);
diff --git a/modules/trigger/trigger.test b/modules/trigger/trigger.test
index 6d60eda9e..a9fbffec3 100644
--- a/modules/trigger/trigger.test
+++ b/modules/trigger/trigger.test
@@ -495,7 +495,7 @@ class TriggerUserActionTestCase extends TriggerActionTestCase {
* Tests user action assignment and execution.
*/
function testUserActionAssignmentExecution() {
- $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'post comments without approval', 'edit own comments'));
+ $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'skip comment approval', 'edit own comments'));
$this->drupalLogin($test_user);
$triggers = array('comment_presave', 'comment_insert', 'comment_update');
@@ -517,7 +517,7 @@ class TriggerUserActionTestCase extends TriggerActionTestCase {
// the comment is updated.
user_save($account, array('status' => TRUE));
- $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'post comments without approval', 'edit own comments'));
+ $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'skip comment approval', 'edit own comments'));
$this->drupalLogin($test_user);
// Our original comment will have been comment 1.
@@ -526,7 +526,7 @@ class TriggerUserActionTestCase extends TriggerActionTestCase {
$this->assertTrue($comment_author_account->status == 0, t('Comment author account (uid=@uid) is blocked after update to comment', array('@uid' => $comment_author_uid)));
// Verify that the comment was updated.
- $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'post comments without approval', 'edit own comments'));
+ $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'skip comment approval', 'edit own comments'));
$this->drupalLogin($test_user);
$this->drupalGet("node/$node->nid");
@@ -627,7 +627,7 @@ class TriggerOtherTestCase extends TriggerWebTestCase {
variable_set($action_id, FALSE);
// Create a node and add a comment to it.
- $web_user = $this->drupalCreateUser(array('create article content', 'access content', 'post comments without approval', 'post comments'));
+ $web_user = $this->drupalCreateUser(array('create article content', 'access content', 'skip comment approval', 'post comments'));
$this->drupalLogin($web_user);
$node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
$edit = array();
diff --git a/modules/user/user.install b/modules/user/user.install
index 00afd2dc0..9d5256e62 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -824,6 +824,20 @@ function user_update_7013(&$sandbox) {
}
/**
+ * Rename the 'post comments without approval' permission.
+ *
+ * In Drupal 7, this permission has been renamed to 'skip comment approval'.
+ */
+function user_update_7014() {
+ db_update('role_permission')
+ ->fields(array('permission' => 'skip comment approval'))
+ ->condition('permission', 'post comments without approval')
+ ->execute();
+
+ return t("Renamed the 'post comments without approval' permission to 'skip comment approval'.");
+}
+
+/**
* @} End of "defgroup user-updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/
diff --git a/modules/user/user.test b/modules/user/user.test
index cbde24b71..91549f0de 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -571,7 +571,7 @@ class UserCancelTestCase extends DrupalWebTestCase {
variable_set('user_cancel_method', 'user_cancel_delete');
// Create a user.
- $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'post comments without approval'));
+ $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'skip comment approval'));
$this->drupalLogin($account);
// Load real user object.
$account = user_load($account->uid, TRUE);
diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install
index 745c43b37..74b66a252 100644
--- a/profiles/standard/standard.install
+++ b/profiles/standard/standard.install
@@ -401,7 +401,7 @@ function standard_install() {
// Enable default permissions for system roles.
$filtered_html_permission = filter_permission_name($filtered_html_format);
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access comments', $filtered_html_permission));
- user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', $filtered_html_permission));
+ user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'skip comment approval', $filtered_html_permission));
// Create a default role for site administrators, with all available permissions assigned.
$admin_role = new stdClass();