Problem/Motivation
See http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
There are three possible callbacks here:
- a form callback, which seems simple but has this quirk which is very helpful to know about:
$form_state = array(
// We need to pass $install_state by reference in order for forms to
// modify it, since the form API will use it in call_user_func_array(),
// which requires that referenced variables be passed explicitly.
'build_info' => array('args' => array(&$install_state)),
'no_redirect' => TRUE,
);
- a batch callback, which gets the &$install_state param, and should return a batch array (AFAIK)
- a regular function callback, which gets the &$install_state param, and whose return I'm unclear about
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #1
jhodgdonI think what is being asked here is that they are documented using our new standards:
http://drupal.org/coding-standards/docs#callback-def
Comment #2
joachim commentedYup. Though given the callback can have 3 different forms, I'm not sure how that can best be done.
Comment #3
jhodgdonperhaps defining three different callback_* functions?
Comment #4
joachim commentedYes, that probably is the clearest way to do it.
(This is why I didn't tag this as Novice BTW! Though if you disagree, feel free to do so :)
Comment #11
msankhala commentedIs this issue still relevant? The provided link in issue description is showing:
Comment #12
longwaveThis documentation has since moved to https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...
The 'type' parameter does document the three different types of callback to some extent - and it does mention the return values of each callback, which the original report seemed to think wasn't clear - but it still seems like we could improve this to provide three sample callbacks with a bit more documentation about each.
Comment #19
quietone commentedThis was an issue at a documentation triage meeting.
The text for the hook has changes since this issue was created. But #2 points out that this is not about the text, it is about meeting coding standards, I think what is being asked here is that they are documented using our new standards: http://drupal.org/coding-standards/docs#callback-def
This needs an Issue Summary update and a patch