[development] Custom FAPI elements in 6.x

Karoly Negyesi karoly at negyesi.net
Thu Aug 23 12:58:09 UTC 2007


thank you so much. I fixed a few things, nothing major.

I discovered one group of core bugs, namely that we use $edit FALSE to determine on _value -- but you can assign FALSE or anything with drupal_execute so func_num_args() is in order. 

Also, we should examine the four after_build calls that remain. I suspect they can be replaced by other constructs now and if so, we should mention in the doc that this is deprecated.

Finally we should make it clear when to use _value and when #process. The question is, can we do everything we do in _value with #process ? I think the answer is yes however it still looks like a healthy split -- if you just want to assign #value then use _value , if you want to split your element after #value is in place, use #process.



----- Start Original Message -----
Sent: Thu, 23 Aug 2007 05:00:53 -0700 (PDT)
From: Karen Stevenson <karen at elderweb.com>
To: Development List <development at drupal.org>
Subject: [development] Custom FAPI elements in 6.x

> I have been working on the CCK 6.x port to rework the widgets to use FAPI. In the process I ran into a number of things that confused me, so I wrote up a tutorial on how to create custom elements in 6.x (at http://drupal.org/node/169815). It includes information on the new #element_validate and #value_callback arguments, as well as how to use hook_elements(), #process, #validate, and #submit, etc., and tries to identify what order things happen in and exactly what information is available at each step in the process.
> I would love to have anyone else familiar with FAPI check to be sure nothing has been misstated, or add anything that might make it clearer or more useful.
> It kind of goes along with the forms workflow illustration at http://drupal.org/node/165104.
> Karen

----- End Original Message -----

More information about the development mailing list