You are here

function flag_views_bookmark_update_prepare in Flag 5

Same name and namespace in other branches
  1. 6.2 includes/flag.views_bookmark.inc \flag_views_bookmark_update_prepare()
  2. 6 includes/flag.views_bookmark.inc \flag_views_bookmark_update_prepare()

Prepare for the Views Bookmark to Flag migration.

Uninstall Flag module if needed. Bring Views Bookmark up to the latest schema.

1 call to flag_views_bookmark_update_prepare()
flag_views_bookmark_update in includes/flag.views_bookmark.inc
Perform all pieces of the update.

File

includes/flag.views_bookmark.inc, line 40
flag.view_bookmark.inc

Code

function flag_views_bookmark_update_prepare() {

  // Ensure the Flag tables are not installed.
  if (db_table_exists('flags')) {

    // Remove Flag tables if already present.
    flag_uninstall();
  }

  // Update Views Bookmark to the latest schema.
  $vb_schema = drupal_get_installed_schema_version('views_bookmark');
  $ret = array();
  if (!empty($vb_schema) && $vb_schema <= 5102) {
    for ($version = $vb_schema + 1; $version <= 5102; $version++) {
      $update_function = 'flag_views_bookmark_update_' . $version;
      if (function_exists($update_function)) {
        $ret += $update_function();
      }
    }
  }
}