Skip to content

Commit

Permalink
Fixes a bug that prevented the healer from working on countries witho…
Browse files Browse the repository at this point in the history
…ut administrative areas.
  • Loading branch information
iamEAP committed Apr 7, 2014
1 parent a763613 commit d115c25
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions scale_addressfield.module
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,32 @@ function scale_addressfield_field_widget_form_alter(&$element, &$form_state, $co
// Add another country validation handler the ensures Address Field
// doesn't unnecessarily trigger form rebuilds.
$country['#element_validate'][] = 'scale_addressfield_prevent_rebuild';
}

// Allow the form healer to be disabled when the ping interval is set to 0.
if ($interval = variable_get('scale_addressfield_ping_interval', 300)) {
// Ensure we have a JS attachment to add some custom settings.
if (!isset($country['#attached']['js'])) {
$country['#attached']['js'] = array();
}
// Allow the form healer to be disabled when the ping interval is set to 0.
if ($interval = variable_get('scale_addressfield_ping_interval', 300)) {
// Ensure we have a JS attachment to add some custom settings.
if (!isset($country['#attached']['js'])) {
$country['#attached']['js'] = array();
}

// Note this form as an enabled form for the healer.
$country['#attached']['js'][] = array(
'type' => 'setting',
'data' => array(
'scale_addressfield' => array(
'interval' => $interval,
'callback' => base_path() . $module_path . '/callbacks/healer.php',
'enabled_forms' => array($form_state['build_info']['form_id']),
),
// Note this form as an enabled form for the healer.
$country['#attached']['js'][] = array(
'type' => 'setting',
'data' => array(
'scale_addressfield' => array(
'interval' => $interval,
'callback' => base_path() . $module_path . '/callbacks/healer.php',
'enabled_forms' => array($form_state['build_info']['form_id']),
),
);

// Attach application logic that runs form health checks at an interval.
$country['#attached']['js'][] = array(
'type' => 'file',
'data' => $module_path . '/js/healer.js',
);
}
),
);

// Attach application logic that runs form health checks at an interval.
$country['#attached']['js'][] = array(
'type' => 'file',
'data' => $module_path . '/js/healer.js',
);
}
}
}
Expand Down

0 comments on commit d115c25

Please sign in to comment.