You are here

function fivestar_update_6103 in Fivestar 6

Same name and namespace in other branches
  1. 6.2 fivestar.install \fivestar_update_6103()

Move comment support to a separate module.

File

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

Code

function fivestar_update_6103() {

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

    // 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() < 6101) {
      module_load_install('fivestar_comment');
      fivestar_comment_update_6100();
    }
  }
  return array();
}