[development] formsapi question: saving additional fields' data

Adrian Rossouw adrian at bryght.com
Wed Apr 26 00:24:41 UTC 2006


On 26 Apr 2006, at 1:45 AM, Gordon Heydon wrote:

>
> Be aware that this will be the only hook_submit() that will be called.
> The default hook_submit() ($form_id .'_submit()') is only added when
> #submit is empty.

Umm. form_alter runs after it has set the default submit callback. [1]

In his example, it would add the callback AFTER the default callback.  
In your
example it would add it BEFORE. Your example could also have used :

array_unshift($form['#submit'], array('function' => array());


======
[1] http://cvs.drupal.org/viewcvs/drupal/drupal/includes/form.inc? 
annotate=1.109

Default submit callbacks are line 98 through 105
form_alter is called on line 111


--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com




More information about the development mailing list