BUG 7422 Solved value not being saved in field checkout

The problem was solved validating the send of the variable $_POST
This commit is contained in:
Douglas Medrano Chura
2011-08-10 18:04:36 -04:00
parent 2573c55db6
commit cf076703c6

View File

@@ -284,6 +284,7 @@ class Form extends XmlForm
*/
function validatePost()
{
$_POST['form']=$this->validateFields($_POST['form']);
return $_POST['form']=$this->validateArray($_POST['form']);
}
@@ -516,5 +517,21 @@ class Form extends XmlForm
return count($notPassedFields) > 0 ? $notPassedFields : false;
}
}
function validateFields($_POST) {
$values = array();
$excludeTypes = array('submit', 'file');
foreach($this->fields as $k => $v) {
if (!in_array($v->type, $excludeTypes)) {
switch($v->type) {
case 'checkbox':
$_POST[$v->name] = isset($_POST[$v->name])? $_POST[$v->name] : $v->falseValue;
break;
default:
}
}
}
return $_POST;
}
}