From a419584b7ff4771240474e64e22f04063ab6e0a4 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Thu, 10 Jun 2010 12:24:23 -0400 Subject: [PATCH] Hermes: fix adding job types form This is a dirty work around to a Horde_Form behavior. Horde_Variables#exists() only checks on expected variables, while Horde_Variables#get() returns the value if one was passed. Since the form name itself isn't "expected", exists() returns false. This work around makes this multi-form page work again. --- hermes/admin.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hermes/admin.php b/hermes/admin.php index 77fb8d492..63ea8c052 100644 --- a/hermes/admin.php +++ b/hermes/admin.php @@ -35,8 +35,14 @@ function _open() } } -if ($vars->exists('formname')) { - switch ($vars->get('formname')) { +// This is a dirty work around to a Horde_Form behavior. +// Horde_Variables#exists() only checks on expected variables, while +// Horde_Variables#get() returns the value if one was passed. Since the form +// name itself isn't "expected", exists() returns false. This work around +// makes this multi-form page work again. +$formname = $vars->get('formname'); +if (!empty($formname)) { + switch ($formname) { case 'addjobtypeform': $form = new AddJobTypeForm($vars); $form->validate($vars); -- 2.11.0