[development] Forms API II: Return of the Chx (you really need toread this)

Jeff Eaton jeff at viapositiva.net
Fri Aug 18 22:58:06 UTC 2006


Adrian Rossouw wrote:
> On 8/18/06, *Jeff Eaton* <jeff at viapositiva.net 
> <mailto:jeff at viapositiva.net>> wrote:
>
>     I think it should be possible. For now, it's very useful to have a
>     flag *in the form itself* that indicates that it's a programmatic
>     submission (ie, isset($form['#post'])).
>      
>     It's definitely something to explore in a subsequent patch.
>
>
> Do we really need to have the entire form array though?
> You can do all kinds of nastiness like remove all the validation, etc.
>
> Also, regarding the guy who was wondering about $_GET. You can just do :
> $form['#post'] = $_GET; or similar.

I guess if a developer is going to go to the bother of loading the form, 
then explicitly removing validation calls, I'm not interested in 
protecting them from whatever happens.

You're right, though, that with the $form_id and a set of values, it is 
technically possible to do the full submission cycle. Such a wrapper 
function would be a bit like drupal_get_form(), just without the 
rendering and redirection logic, etc. drupal_do_stuff($form_id, 
$form_values)... I'm not really sure what the best name for it would be, 
but yes -- that would indeed do the trick. Unless of course the form 
builder would need additional parameters in addition to $form_values.

--Jeff



More information about the development mailing list