summaryrefslogtreecommitdiff
path: root/modules/comment/comment.install
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-25 11:54:40 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-25 11:54:40 +0000
commitca2c6441eb0e739028764f0990dea8b31c4f1914 (patch)
treec18d09095ab1c2c7cf637039b3660633f9811299 /modules/comment/comment.install
parenta5181519cafda3185b05a19f94c1f0a47d818269 (diff)
downloadbrdo-ca2c6441eb0e739028764f0990dea8b31c4f1914.tar.gz
brdo-ca2c6441eb0e739028764f0990dea8b31c4f1914.tar.bz2
#891250 by scor: Fixed 'View comments' permission not working after upgrade to Drupal 7.
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r--modules/comment/comment.install17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 344aa333e..412c8fc05 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -120,17 +120,20 @@ function comment_update_7000() {
* Change comment status from published being 0 to being 1
*/
function comment_update_7001() {
+ // Choose a temporary status value different from the existing status values.
+ $tmp_status = db_query('SELECT MAX(status) FROM {comments}')->fetchField() + 1;
+
$changes = array(
- 3 => 0,
- 0 => 1,
- 1 => 3,
+ 0 => $tmp_status,
+ 1 => 0,
+ $tmp_status => 1,
);
foreach ($changes as $old => $new) {
- db_update('comments')
- ->fields(array('status' => $new))
- ->condition('status', $old)
- ->execute();
+ db_update('comments')
+ ->fields(array('status' => $new))
+ ->condition('status', $old)
+ ->execute();
}
}