We currently only have a Form API doc section for Drupal 6.
http://drupal.org/node/204270

Not much has changed in FAPI for Drupal 7. My recommendation would be to change the header of the D6 version to say D6 and D7, and go through the pages, update their version taxonomy to include Drupal 7, and edit, noting any minor changes that may have occurred.

Related issue: #708304: Documentation for hook_element_info() still reports a link for http://drupal.org/node/169815

Comments

jhodgdon’s picture

Issue I just marked as duplicate of this one:
#767368: write D7 version of the FormAPI guide

arianek’s picture

Priority: Normal » Critical
rfay’s picture

Actually there are quite a lot of changes. We've been working on the FAPI doc as time went on, and I've written some blogs about the changes.

jhodgdon’s picture

Component: New documentation » Correction/Clarification
Issue tags: +developer

tagging (this is the tag for developer-oriented doc issues in the docs project)

jhodgdon’s picture

Issue tags: +form API
aquariumtap’s picture

Related: the link to the Form API Quickstart Guide on the D7 FAPI page is written for D6. Would be good to note that to avoid confusion.

phryk’s picture

The documentation of hook_element_info() is partly wrong.

The callbacks set with #pre_render are only called with one argument, $element.

Also there is no info on when the callbacks defined in hook_element_info() are called, what they are good for and what they ought to return.

For instance: The callbacks in #process, #after_build, #pre_render and #post_render need to return $element for the element to be rendered at all. Also the callbacks in #submit (which would be about the most important, I'd say) don't seem to be called *at all*

Compared to the rest of the drupal documentation, the doc on creating custom form elements is a real eyesore.

jhodgdon’s picture