From 17b01a06412ea4c96d67996304072b99e3bfdca5 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Thu, 19 May 2011 17:21:23 -0400 Subject: [PATCH] BUG 6901 "No se valida el como campos requeridos el dropdown, checkb..." (fixed) There were two fields more to fix for this validatio: listbox & checkgroups, but now are already fixed --- gulliver/system/class.form.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index e8d54cebc..45f77face 100644 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -304,8 +304,14 @@ class Form extends XmlForm if ($v->type != 'file') { if ( array_key_exists($k,$newValues) ) { switch($v->type){ - case 'checkgroup': case 'listbox': - $values[$k] = implode('|', $newValues[$k]); + case 'checkgroup': + case 'listbox': + if (count($newValues[$k]) > 1) { + $values[$k] = implode('|', $newValues[$k]); + $newValues[$k] = $values[$k]; + } else { + $values[$k] = $newValues[$k][0]; + } break; case 'dropdown': $values[$k] = $newValues[$k]; @@ -459,6 +465,8 @@ class Form extends XmlForm } } } + g::dump($rFields); + g::dump($values); foreach($rFields as $field){ #we verify if the requiered field is in array values,. t if (array_key_exists($field, $values)) {