You are here

function google_adwords_update_6102 in Google AdWords Conversion Tracking 6

Translate old role tracking variables to new role tracking variables

Update for 6.x-1.x branches should start with 6101, not 6001

See also

http://api.drupal.org/api/drupal/developer--hooks--install.php/function/...

File

./google_adwords.install, line 98

Code

function google_adwords_update_6102() {
  $roles = user_roles();
  foreach ($roles as $rid => $name) {
    $old_key = 'google_adwords_track_' . str_replace(' ', '_', $name);
    $new_key = 'google_adwords_track_' . $rid;
    variable_set($new_key, variable_get($old_key, FALSE));
    variable_del($old_key);
  }
  return array();
}