You are here

function rules_forms_update_7102 in Rules Forms Support 7

Same name and namespace in other branches
  1. 7.2 rules_forms.install \rules_forms_update_7102()

Unset rules_forms_event_info array values with empty keys.

To cleanse the settings array of bad form information.

See also

http://drupal.org/node/1447328#comment-5640172

File

./rules_forms.install, line 52
Installation function for Rules Forms module.

Code

function rules_forms_update_7102() {
  $event_info = variable_get('rules_forms_event_info', array());
  foreach ($event_info as $key => $value) {

    // Any form of empty key is unwanted (NULL, 0, FALSE, '', etc).
    if (empty($key)) {
      unset($event_info[$key]);
    }
  }
  variable_set('rules_forms_event_info', $event_info);
}