Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294288

document Form API #process callback in form.api.php

$
0
0

Problem/Motivation

By adopting new standard ways to document callback functions, the current documentation has to use the
standards defined in http://drupal.org/coding-standards/docs#callback-def.
At the moment the documentation follows the common documentation standards of D7.

Proposed resolution

Change the documentation according to http://drupal.org/coding-standards/docs#callback-def.

update first line of function according to following example
example for existing documentation

/**
  * Processes a select list form element.
  */

should be changed to (new standard)

/**
  * Implements callback_form_element_process() for select elements.
  */

Original report by joachim

We recently adopted a new standard way to document "callback functions" -- see http://drupal.org/coding-standards/docs#callback-def for the standard and #1250500: [policy adopted; patch done] Find a (standard) way to document callback signatures for the issue where this was adopted.

The FormAPI #process callback should be documented as part of this.

This would also require the form API docs at http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc... to be changed to refer to the new callback documentation.

Some interesting things about #process that should be documented:

- its function signature is (&$element, &$form_state, &$form)
- it gets the complete form the element is on, which is alterable. This is mentioned in passing in https://api.drupal.org/api/drupal/modules!field!field.api.php/function/h....
- various snippets of info about this are in form_builder() docs, and could do to be mentioned here too

See also #1985838: document Form API #element_validate callback.


Viewing all articles
Browse latest Browse all 294288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>