Projet

Général

Profil

Révision 6331c987

Ajouté par Assos Assos il y a environ 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/i18n/i18n.install
22 22
}
23 23

  
24 24
/**
25
 * Add fields to schema if they don't exist
25
 * Add fields to the schema if they don't exist.
26
 *
27
 * @param string $table
28
 *   The name of the database table.
29
 * @param array $fields
30
 *   The list of database fields to create.
31
 * @param boolean $force_rebuild_schema
32
 *   Whether to force drupal_get_schema() to rebuild the schema. This may be
33
 *   necessary when additional implementations of hook_schema_alter() have
34
 *   become available since the schema was originally built.
26 35
 */
27
function i18n_install_create_fields($table, $fields) {
36
function i18n_install_create_fields($table, $fields, $force_rebuild_schema = FALSE) {
28 37
  static $schema;
29
  // Do not force schema refresh more than once per request.
30
  $schema = drupal_get_schema($table, !isset($schema));
38
  $rebuild_schema = !isset($schema) || $force_rebuild_schema;
39
  $schema = drupal_get_schema($table, $rebuild_schema);
31 40
  foreach ($fields as $field) {
32 41
    if (!empty($schema['fields'][$field])) {
33 42
      if (!db_field_exists($table, $field)) {

Formats disponibles : Unified diff