comment_update_7009

Versions
7
comment_update_7009()

Update preview setting variable to use new constants

Related topics

Code

modules/comment/comment.install, line 179

<?php
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();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.