You are here

function fivestar_update_5702 in Fivestar 5

Move comment support to a separate module.

File

./fivestar.install, line 83
Installation file for fivestar module.

Code

function fivestar_update_5702() {

  // Comment support was added in schema version 1.
  if (fivestar_update_version() > 0) {

    // Enable the module, but don't run the install hook (tables already exist).
    if (module_exists('comment')) {
      module_rebuild_cache();
      module_enable(array(
        'fivestar_comment',
      ));
      $version = array_pop(drupal_get_schema_versions('fivestar_comment'));
      drupal_set_installed_schema_version('fivestar_comment', $version);
      module_rebuild_cache();
    }

    // If the comment table needs an update, run fivestar_comment_update_5100().
    if (fivestar_update_version() < 5701) {
      module_load_install('fivestar_comment');
      fivestar_comment_update_5100();
    }
  }
  return array();
}