Commit c80c4d94 authored by ram4nd's avatar ram4nd

Fix saving of values, had some strings in wrong case.

parent e9e792d8
......@@ -120,8 +120,8 @@ function commerce_omniva_field_settings_form($field, $instance, $has_data) {
*/
function commerce_omniva_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
foreach ($items as $delta => $item) {
if (!empty($item['ZIP'])) {
if (! is_numeric($item['ZIP'])) {
if (!empty($item['zip'])) {
if (! is_numeric($item['zip'])) {
$errors[$field['field_name']][$langcode][$delta][] = array(
'error' => 'commerce_omniva_invalid',
'message' => t('You must select a location.'),
......@@ -139,7 +139,7 @@ function commerce_omniva_field_validate($entity_type, $entity, $field, $instance
* the form API flag an error when required fields are empty.
*/
function commerce_omniva_field_is_empty($item, $field) {
return empty($item['ZIP']);
return empty($item['zip']);
}
/**
......@@ -174,7 +174,7 @@ function commerce_omniva_field_formatter_view($entity_type, $entity, $field, $in
'#tag' => 'p',
'#value' =>
'<label> ' . $t_name . ':</label> ' .
$place[$item['ZIP']]['NAME'],
$place[$item['zip']]['NAME'],
);
}
break;
......@@ -205,7 +205,7 @@ function commerce_omniva_field_widget_info() {
*
*/
function commerce_omniva_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
$value = isset($items[$delta]['ZIP']) ? $items[$delta]['ZIP'] : '';
$value = isset($items[$delta]['zip']) ? $items[$delta]['zip'] : '';
$places = commerce_omniva_locations();
$country = $field['settings']['commerce_omniva_zip_country'];
......@@ -237,7 +237,7 @@ function commerce_omniva_field_widget_form(&$form, &$form_state, $field, $instan
break;
}
$element['ZIP'] = $widget;
$element['zip'] = $widget;
return $element;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment