diff options
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 3d2b9e743..054919530 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -24,6 +24,38 @@ function comment_update_1() { return array(); } +function comment_update_6001() { + $ret[] = update_sql("ALTER TABLE {comments} DROP score"); + $ret[] = update_sql("ALTER TABLE {comments} DROP users"); + return $ret; +} + +/** + * Changed comment settings from global to per-node -- copy global + * settings to all node types. + */ +function comment_update_6002() { + $settings = array( + 'comment_default_mode' => COMMENT_MODE_THREADED_EXPANDED, + 'comment_default_order' => COMMENT_ORDER_NEWEST_FIRST, + 'comment_default_per_page' => 50, + 'comment_controls' => COMMENT_CONTROLS_HIDDEN, + 'comment_anonymous' => COMMENT_ANONYMOUS_MAYNOT_CONTACT, + 'comment_subject_field' => 1, + 'comment_preview' => COMMENT_PREVIEW_REQUIRED, + 'comment_form_location' => COMMENT_FORM_SEPARATE_PAGE, + ); + $types = node_get_types(); + foreach ($settings as $setting => $default) { + $value = variable_get($setting, $default); + foreach ($types as $type => $object) { + variable_set($setting .'_'. $type, $value); + } + variable_del($setting); + } + return array(); +} + /** * Implementation of hook_schema(). */ |