Projet

Général

Profil

Révision cd5c298a

Ajouté par Geoffroy Desvernay il y a environ 5 ans

MAJ 7.60 -> 7.62

Voir les différences:

drupal7/modules/field/modules/list/list.install
61 61

  
62 62
      // Additionally, float keys need to be disambiguated ('.5' is '0.5').
63 63
      if ($field['type'] == 'list_number' && !empty($allowed_values)) {
64
        $keys = array_map(create_function('$a', 'return (string) (float) $a;'), array_keys($allowed_values));
64
        $keys = array_map('_list_update_7001_float_string_cast', array_keys($allowed_values));
65 65
        $allowed_values = array_combine($keys, array_values($allowed_values));
66 66
      }
67 67

  
......
88 88
  }
89 89
}
90 90

  
91
/**
92
 * Helper callback function to cast the array element.
93
 */
94
function _list_update_7001_float_string_cast($element) {
95
  return (string) (float) $element;
96
}
97

  
91 98
/**
92 99
 * Helper function for list_update_7001: extract allowed values from a string.
93 100
 *

Formats disponibles : Unified diff