Commit 312e0eda authored by ram4nd's avatar ram4nd
Browse files

Fix nested positive ifs.

parent 24bd859c
...@@ -72,13 +72,11 @@ function commerce_omniva_field_settings_form($field, $instance, $has_data) { ...@@ -72,13 +72,11 @@ function commerce_omniva_field_settings_form($field, $instance, $has_data) {
*/ */
function commerce_omniva_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { function commerce_omniva_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
foreach ($items as $delta => $item) { foreach ($items as $delta => $item) {
if (!empty($item['zip'])) { if (!empty($item['zip']) && !is_numeric($item['zip'])) {
if (!is_numeric($item['zip'])) { $errors[$field['field_name']][$langcode][$delta][] = array(
$errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'commerce_omniva_invalid',
'error' => 'commerce_omniva_invalid', 'message' => t('You must select a location.'),
'message' => t('You must select a location.'), );
);
}
} }
} }
} }
......
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