/**
  * Reset all data structures after having enabled new modules.
  *
  * This method is called by BackdropWebTestCase::setUp() after enabling
  * the requested modules. It must be called again when additional modules
  * are enabled later.
  */
 protected function resetAll()
 {
     // Reset all static variables.
     backdrop_static_reset();
     // Reset the list of enabled modules.
     module_list(TRUE);
     // Reset cached schema for new database prefix. This must be done before
     // backdrop_flush_all_caches() so rebuilds can make use of the schema of
     // modules enabled on the cURL side.
     backdrop_get_schema(NULL, TRUE);
     // Perform rebuilds and flush remaining caches.
     backdrop_flush_all_caches();
     // Reload global $conf array and permissions.
     $this->refreshVariables();
     $this->checkPermissions(array(), TRUE);
 }
示例#2
0
/**
 * Act on deletion of a field.
 *
 * This hook is invoked from field_delete_field() to ask the field storage
 * module to mark all information stored in the field for deletion.
 *
 * @param $field
 *   The field being deleted.
 */
function hook_field_storage_delete_field($field)
{
    // Mark all data associated with the field for deletion.
    $field['deleted'] = 0;
    $table = _field_sql_storage_tablename($field);
    $revision_table = _field_sql_storage_revision_tablename($field);
    db_update($table)->fields(array('deleted' => 1))->execute();
    // Move the table to a unique name while the table contents are being deleted.
    $field['deleted'] = 1;
    $new_table = _field_sql_storage_tablename($field);
    $revision_new_table = _field_sql_storage_revision_tablename($field);
    db_rename_table($table, $new_table);
    db_rename_table($revision_table, $revision_new_table);
    backdrop_get_schema(NULL, TRUE);
}