summaryrefslogtreecommitdiff
path: root/modules/comment/comment.install
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r--modules/comment/comment.install20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 272c50944..640b54f7f 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -175,6 +175,26 @@ function comment_update_7008() {
}
/**
+ * Update preview setting variable to use new constants
+ */
+function comment_update_7009() {
+ foreach (node_type_get_types() as $type => $object) {
+ // There were only two comment modes in the past:
+ // - 1 was 'required' previously, convert into DRUPAL_REQUIRED (2).
+ // - 0 was 'optional' previously, convert into DRUPAL_OPTIONAL (1).
+ $original_preview = variable_get('comment_preview_' . $type, 1);
+ if ($original_preview) {
+ $preview = DRUPAL_REQUIRED;
+ }
+ else {
+ $preview = DRUPAL_OPTIONAL;
+ }
+ variable_set('comment_preview_' . $type, $preview);
+ }
+ return array();
+}
+
+/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/