[horde] Form & Variable Classes

Mike Bydalek mbydalek at mobilemini.com
Thu Nov 18 07:11:30 PST 2004


I tried to hunt this one down, but hit some dead ends because everything 
"looked right" to me.  Since I wasn't using a 100%-pure cvs to look into 
this at first, I decided to checkout a base install and then used Whups 
as my test platform.

When I added the attached patch, went to create a ticket from Step 1 -> 
Step 2 -> Step 3, very strange things were observed.  The only thing I 
can say is look for yourself.  Step 1 and Step 2 process the hidden just 
fine.  But then in step 3, everything is lost for some unknown reason.

I'm pretty sure this is a bug, but I want to be 100% sure.

Thanks for your time,
Mike
-------------- next part --------------
--- whups/lib/Create.php.orig	Thu Nov 18 07:49:14 2004
+++ whups/lib/Create.php	Thu Nov 18 07:47:32 2004
@@ -49,6 +49,9 @@
 
         parent::Horde_Form($vars, _("Create Ticket - Step 2"));
 
+        $myhidden = &$this->addHidden('Hidden', 'myhiddenvar', 'text', false);
+        $myhidden->setDefault(999);
+
         $types = $whups->getTypes($vars->get('queue'));
         $info  = $whups->getQueue($vars->get('queue'));
         if (count($types) == 0) {
--- whups/ticket/create.php.orig	Thu Nov 18 07:49:14 2004
+++ whups/ticket/create.php	Thu Nov 18 07:45:49 2004
@@ -36,6 +36,15 @@
 $valid2 = $form2->validate($vars, true);
 $valid1 = $form1->validate($vars, true);
 
+$variables = $form2->getVariables(true, true);
+
+foreach ($variables as $var) {
+    echo $var->getHumanName() . ": " . $vars->get($var->getVarName()) . "<br>";
+}
+
+$form2->getInfo($vars, $temp);
+echo "Form 2 Info: " . print_r($temp, 1) . "<br>";
+
 if (!$valid3 ||
     !$valid2 ||
     !$valid1 ||


More information about the horde mailing list