You are here

function fivestar_update_7201 in Fivestar 7.2

Fixes the axis value stored for fivestar fields.

File

./fivestar.install, line 39
Install, update, and uninstall functions the Fivestar module.

Code

function fivestar_update_7201() {
  drupal_load('module', 'fivestar');
  $fields = field_read_fields(array(
    'module' => 'fivestar',
  ));
  $tags_numeric = array_values(fivestar_get_tags());
  foreach ($fields as $field) {
    if (is_numeric($field['settings']['axis'])) {
      $field['settings']['axis'] = $tags_numeric[$field['settings']['axis']];
    }
  }
}