[development] Formapi formalter

Bèr Kessels ber at webschuur.com
Thu Mar 23 08:45:59 UTC 2006


Hi list,

Form api is supposed to have this great form alter feature. In theory it is 
indeed great. And for small forms, it is very usefull.
In fact, it is fabulous for <em>adding</em> information to a form.

But not so much for actually altering a form. We found out the hard way, that 
a node submission form cannot be altered.

The plan was, to use taxonomy (free tagging) to collect "cities", "keywords", 
"countries" etc. Taxonomy is very usefull for that, but it comes in a 
collapsible form (ugh) all grouped.
Form alter to the rescue. Just flatten the array (pull the taxonomy out of the 
collapsible) and change the weights, so that we could place them whereever we 
wanted them.
The form looks great, then. Looks. But it is altered, and threfore does not 
behave the way it did. Taxonomy now does not know about any of the filled 
terms anymore, and simply ignores them: taxonomy terms are not saved to the 
database.

Is there some way to alter-yet-not-alter. Do we really need to build the 
ordering and so inside the theme. I cannot imagine that form alter is this 
much limited. Because this example can be extended to anything: As soon as 
you really alter the form, the specific modules no longer will be able to 
find the data, and will simply break?

Am I missing something? Is there some secret API, or #coolthing?

Bèr


More information about the development mailing list