Commit ca2c6441 authored by webchick's avatar webchick

#891250 by scor: Fixed 'View comments' permission not working after upgrade to Drupal 7.

parent a5181519
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment