Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
forms system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2006 at 19:05 UTC
Updated:
25 Jun 2007 at 07:17 UTC
Imagine I have module with multiple forms with dynamical ids built by one builder function using hook_forms(). It is obvious that my module requires to submit all those forms to single one "..._submit" function. Right now Drupal searches for _submit for every form id, so I have to set $form['#submit'] explicitly in my form builder function, it tooks some time to investigate it from forms.inc. Isn't it would be better to assume submit function name by callback name provided by hook_forms()?
| Comment | File | Size | Author |
|---|---|---|---|
| dynamic_form_ids_patch.txt | 1.05 KB | sin |
Comments
Comment #1
sin commentedComment #2
webchickIn 6.x, the form API was simplified to make it more consistent, and one of these simplifications was removing the #base property in favour of always specifying explicit callbacks. From the FAPI maintainer:
chx: if there would be a #base then this patch would be a very good idea, set #base automatically for hook_forms -- but #base is gone.
Therefore, I'm setting this to "won't fix" ... sorry. :\
Comment #3
sin commented:)
Changing API's to make them better is a thing I like Drupal for. Thanks for your comment, webchick.
I remember I have troubles finding code examples of how to specify callbacks explicitly, so please, provide some in http://api.drupal.org/api/HEAD/file/developer/topics/forms_api.html