[whups] Add User code question

Mike Baptiste mike@msbnetworks.net
Mon Nov 11 17:22:52 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK, so I'm still chewing on the PHP object model trying to fix this
dupliicate User field when editing a Module's user owners.  (CLick users
responsible for this module when editing a module - I get the User field
twice)

in whups/admin.php:

~    case 'adduserform':
~        $whups_admin_form = 'module';
|>>>> SO below we get a new form object and during init, the hidden and
user field vars get added, right?
~        $form = &_getAddUserForm($vars);
~        $form->validate($vars);

~        if ($form->isValid()) {
[snip]
~        }

~        _open();

~        $form1 = &_getEditUserStep1Form($vars);
~        $form1->close($RENDERER);


~        $vars = &new Horde_Form_Vars(array('module' =>
$vars->getVar('module')));
|>>>>> When this gets called, the User field and hidden var get added
AGAIN.  But wait - should the &new Horde_Form_Vars wipe out anything
that got added in &_getAddUserForm?  Or did something change in object
init in php 4.2.3?
~        $form->AddUserForm($vars);

~        $form->open($RENDERER, $vars, 'admin.php', 'post');
~        $RENDERER->beginActive(sprintf(_("Add a user to '%s'"),
$info['name']));
~        $RENDERER->renderFormActive($form, $vars);
~        $RENDERER->submit();
~        $RENDERER->end();
~        $form->close($RENDERER);

~        break;

So if I remove the call to the AddUserForm method after the new vars
method call, the 2nd User form goes away, but I'm not sure if this
breaks something else.

This is also a problem in the 'edituserform' case and the
edituserstep1form case (except here, the select pulldown repeats twice
due to the $form->EditUserStep1Form($vars); call at the end of the
$form->isValid block.

SO anyone with a better handle on PHP and objects is probably betetr
suited to fix this than I.  But I'm still plugging away.

Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9z+drtbf8BjvL+3ERAj6LAKC+4FVTmHqrE+O8DzPMA7GC2seLVwCeLR3E
L74mHbEZkon/8wOzWKCNT2Q=
=7r8g
-----END PGP SIGNATURE-----



More information about the whups mailing list