Commit 04ee6b0e authored by Ben Bradshaw's avatar Ben Bradshaw
Browse files

More pieforms fixes - you should only access $global if the form has

been submitted
(cherry picked from commit e066214f)
parent f076ecf2
......@@ -47,7 +47,8 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
$bytes = $element['value'];
$values = pieform_element_bytes_get_bytes_from_bytes($element['value']);
}
else if (isset($global[$element['name']])
else if ($form->is_submitted()
&& isset($global[$element['name']])
&& isset($global[$element['name'] . '_units'])) {
$values = array('number' => $global[$element['name']],
'units' => $global[$element['name'] . '_units']);
......
......@@ -47,7 +47,8 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/
$seconds = $element['value'];
$values = pieform_element_expiry_get_expiry_from_seconds($element['value']);
}
else if (isset($global[$element['name']])
else if ($form->is_submitted()
&& isset($global[$element['name']])
&& isset($global[$element['name'] . '_units'])) {
$values = array('number' => $global[$element['name']],
'units' => $global[$element['name'] . '_units']);
......
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