diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-16 13:20:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-16 13:20:16 +0000 |
commit | 5a89fef970b26af6eb1d970ad8a9a5876e4126df (patch) | |
tree | 428fb3cdfba1db14551b2a84a1992adeb8e8d359 /modules/comment/comment.install | |
parent | f0a8150b1160e47d7d2865836240f973292ac68d (diff) | |
download | brdo-5a89fef970b26af6eb1d970ad8a9a5876e4126df.tar.gz brdo-5a89fef970b26af6eb1d970ad8a9a5876e4126df.tar.bz2 |
- Patch #275368 by michaelfavia, sun, mattconnolly: allow disabling comment preview + unify with node preview settings.
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 20 |
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. */ |