[Jifty-commit] r5216 - jifty/trunk/lib/Jifty/Web/Form

Jifty commits jifty-commit at lists.jifty.org
Thu Mar 13 14:47:58 EDT 2008


Author: clkao
Date: Thu Mar 13 14:47:57 2008
New Revision: 5216

Modified:
   jifty/trunk/lib/Jifty/Web/Form/Field.pm

Log:
re-merge r5120 given now regions know if they are in a opened form.

 Don't auto register field's action unless we are in
 an open form.  This fixes the case where actions aren't
 properly registered to the correct form:
 
 my $foo = $action->form_field('foo')->element_id;
 
 form {
     render_action($action); form_submit;
 }
 


Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm	Thu Mar 13 14:47:57 2008
@@ -88,7 +88,7 @@
     }
 
     # now that the form field has been instantiated, register the action with the form.
-    if ($self->action and not (Jifty->web->form->has_action($self->action))) {
+    if ($self->action and Jifty->web->form->is_open and not (Jifty->web->form->has_action($self->action))) {
         Jifty->web->form->register_action( $self->action);
         Jifty->web->form->print_action_registration($self->action->moniker);
     }


More information about the Jifty-commit mailing list