You are here

function og_migrate_is_pending in Organic groups 7

Return TRUE if there are pending migration plugins.

1 call to og_migrate_is_pending()
og_migrate_init in og_migrate/og_migrate.module
Implements hook_init().

File

og_migrate/og_migrate.module, line 259
Migrate and upgrade Organic groups data.

Code

function og_migrate_is_pending() {
  $plugins = og_migrate_get_accessible_plugins();
  if (!$plugins) {
    return FALSE;
  }
  $plugin_names = array();
  foreach ($plugins as $name => $plugin) {
    $plugin_names[] = $name;
  }

  // Check if the plugins are already executed.
  $query = db_select('og_migrate', 'ogm');
  $result = $query
    ->fields('ogm', array(
    'plugin',
  ))
    ->condition('plugin', $plugin_names, 'IN')
    ->condition('status', OG_MIGRATE_EXECUTED, '!=')
    ->countQuery()
    ->execute()
    ->fetchField();
  return (bool) $result;
}