From ca2c6441eb0e739028764f0990dea8b31c4f1914 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 25 Aug 2010 11:54:40 +0000 Subject: #891250 by scor: Fixed 'View comments' permission not working after upgrade to Drupal 7. --- modules/comment/comment.install | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'modules/comment') 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(); } } -- cgit v1.2.3