You are here

function biblio_check_biblio_migration_needed in Bibliography Module 7.3

Check whether Biblio migration from 1.x to 3.x is needed.

Return value

bool TRUE if Biblio 1.x migration needs to be registered.

1 call to biblio_check_biblio_migration_needed()
biblio_migrate_api in ./biblio.module
Implements hook_migrate_api().

File

./biblio.module, line 976
Maintains bibliographic lists.

Code

function biblio_check_biblio_migration_needed() {
  if (!module_exists('migrate')) {

    // Migrate module is not a dependency, so we need to verify it is installed.
    return;
  }
  if (!module_exists('migrate_extras')) {
    return;
  }
  if (!db_table_exists('_biblio_1x')) {

    // Migrate is relevant only if there is old Biblio 1.x DB table to work on.
    return;
  }
  if (!class_exists('MigrateDefaultFieldHandler')) {

    // We need to make sure we've got at least the Migrate 2.6 beta - identify
    // it by the new MigrateDefaultFieldHandler class.
    return;
  }
  return TRUE;
}