Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
commerce_omniva
Commits
c80c4d94
Commit
c80c4d94
authored
Aug 25, 2015
by
ram4nd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix saving of values, had some strings in wrong case.
parent
e9e792d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
commerce_omniva.module
commerce_omniva.module
+6
-6
No files found.
commerce_omniva.module
View file @
c80c4d94
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment