You are here

function user_relationships_update_7000 in User Relationships 7

Migrate existing message settings.

File

./user_relationships.install, line 110
User Relationships API Module installation file.

Code

function user_relationships_update_7000() {

  // Get all variables with the old prefix.
  $result = db_query("SELECT * FROM {variable} WHERE name LIKE 'user_relationships_ui_msg_%'");
  foreach ($result as $variable) {

    // Save as new variable.
    variable_set(str_replace('_ui', '', $variable->name), unserialize($variable->value));

    // Delete the old variable.
    variable_del($variable->name);
  }
}