Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
5 Feb 2008 at 02:34 UTC
Updated:
19 Aug 2009 at 12:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
webchickThat would be critical. Thanks for the report.
Comment #2
Nick Lewis commentedIn addition to those hooks, hook_theme_registry_alter is undocumented. Am searching for other hooks that aren't documented.
Comment #3
Nick Lewis commentedDid a search of the d6 codebase's calls to module_invoke, and uncovered this heap of undocumented hooks (hooks cannot be found at http://api.drupal.org/api/file/developer/hooks/core.php/6 ) .
After the missing hook is the file, and line I found them. Many of these hooks are quite useful. In addition, I suspect a number of them are undocumented for versions earlier than 6.
1. hook_hook_info (trigger.module, 28)
2. hook_action_info ((actions.inc, 156)
3. hook_theme_registry_alter
4. hook_actions_delete (actions.inc, 364)
5. hook_schema (common.inc, 3046)
6. hook_locale (locale.inc, 486)
7. hook_flush_caches (common.inc, 3525)
8. hook_check_http_request (common.inc, 425)
9. hook_requirements (install.inc 720)
10. hook_enable (module.inc, 306)
11. hook_disable (module.inc, 333)
12. hook_get_vocabularies (blogapi, 398)
13. hook_get_tree (blogapi, 402)
14. hook_get_parents(blogapi, 405)
15. hook_status (block, 446)
16. hook_update_last_removed (update.php, 219)
17. hook_uninstall (install.inc, 691)
18. hook_form_all (node.module, 1846)
19. hook_language_name (path.admin.inc, 48)
20. hook_search_page (serach.module, 1147)
21. hook_system_update (system.admin.inc, 312)
Comment #4
dvessel commentedI'll take care of hook_theme_registry_alter. I promised to do it a long time ago but I completely forgot about it.
The others I have no clue on.
Comment #5
webchickI'd like to just remind everyone that anyone with a CVS account can update this documentation. The files to update are in contributions/docs/developer in files like core.php, etc. Both in the DRUPAL-6--1 and HEAD branches.
Even if you think you have no idea how a hook works, simply copy/pasting an entry for it and reading the surrounding code and making an initial stab at some text is better than the big ol' nothing we have now. Work with some people in #drupal if you have questions; chances are, someone in there knows and this is a great way to get your name out there as a contributor!
Comment #6
oadaeh commentedThese appear to now have documentation: hook_schema, hook_requirements, hook_enable, hook_disable, hook_uninstall.
Comment #7
nancydruEven though I reported it ages ago, hook_term_path is still undocumented.
Hook_submit is still documented even though it is gone.
Comment #8
Anonymous (not verified) commentedStill to complete:
hook_theme_registry_alter
hook_actions_delete (actions.inc, 364)
hook_locale
hook_flush_caches
hook_check_http_request
hook_requirements
hook_enable
hook_disable
hook_get_vocabularies
hook_get_tree
hook_get_parents
hook_status
hook_update_last_removed
hook_uninstall
hook_form_all
hook_language_name
hook_search_page
hook_system_update
Comment #9
nancydruI checked again and some of those were done. Still to go:
hook_theme_registry_alterhook_actions_delete (actions.inc, 364)
hook_locale
hook_flush_cacheshook_check_http_request
hook_get_vocabularieshook_get_treehook_get_parentshook_term_pathhook_status
hook_update_last_removed
hook_form_all
hook_language_name
hook_search_page
hook_system_update
Comment #10
nancydruIf someone can point me to a post that tells me how to update the docs (yes, I have a CVS account), and if there are special formatting requirements, I'll take a shot at a few of them.
Comment #11
nancydruWell, if I managed to do it right, hook_flush_caches and hook_term_path have been added to both HEAD and DRUPAL-6--1
Comment #12
webchickYep, you did it right. :) I don't know if docs exist, but you basically make changes and commit it, like any other file.
Comment #13
nancydruWhen do they roll up? I won't do any more until I see how those turned out.
*EDIT*: I see both of them in the APIs now, but the text for hook_term_path is not displayed. What did I do wrong?
Comment #14
webchickIt might be the newline between the "*/" and the "function" on that one. That's the only thing I can see.
Comment #15
nancydruWell, I guess we'll find out. I just removed that. When does it next roll out?
Comment #16
webchickhttp://api.drupal.org/support says "If documentation does not match the Drupal source code after a half day, file an issue in the infrastructure project.".. not sure how often it actually runs tho.
Comment #17
sepeck commentedit depends on if drumm is working on it. I know he had plans for it this week.
Comment #18
nancydruSo it is basically, "We'll see it when we see it?"
Comment #19
Island Usurper commentedhook_hook_info() wasn't in DRUPAL-6--1, but I found it in HEAD. Committed to D6 branch.
Comment #20
nancydru@Island Usurper: are you sure it's a 6.x function?
*EDIT* Never mind, I see it's used in at least: comment, node, system, taxonomy, and user.
Comment #21
webchickI'm handling hook_theme_registry_alter() at http://drupal.org/node/259116. Eyeballs appreciated.
Comment #22
webchickFixing title. hook_theme_registry_alter() is now documented, although merlin is helping me tweak the final bits.
Comment #23
webchickOk, going through Nancy's latest list, there were actually only two of those that are hooks: hook_actions_delete() and hook_locale().
The rest are ones called with module_invoke('something', 'something') which is NOT the same as a hook. That's basically a "safe" way to call a function like taxonomy_form_all() if you don't know if taxonomy module is going to be there for sure or not. Confusing, I know.
Anyway, I committed some boilerplate text for both of these hooks to serve as at least documentation that they exist. hook_actions_delete() is pretty straight-forward, but I have no idea what hook_locale() is supposed to do. I've re-opened the locale issue @ #139970: The big locale cleanup (and adding text domain functionality) in the hopes that one of the folks who worked on that will spruce up the docs.
In the meantime, I'm marking this fixed. FINALLY. Hooray.
Comment #24
webchickBLAH. spoke too soon. I grepped for drupal_alter and re-grepped for module_invoke_all found some more:
hook_action_info #148410: Actions in core
hook_action_info_alter #148410: Actions in core
hook_openid #131026: OpenID Consumer/Relying Party support in core for 6.x
hook_translation_link_alter #141996: Language switcher block
hook_system_info_alter #141727: Regression: Allow maintenance to be themable
hook_update_status_alter #94154: update.module in core (formerly known as update_status) (granted, this basically only exists for update_advanced.module's use but still...)
And hook_locale #139970: The big locale cleanup (and adding text domain functionality)
Comment #25
webchickAs a new strategy, I went through CVS annotate and re-opened all of the issues that originally committed these patches without documentation, in the hopes that the people who made the changes in the first place will do so.
We'll see. ;P Anyway, I've spent enough time for one weekend screwing with this.
Comment #26
nancydruThanks, Angie.
Comment #27
webchickComment #28
pwolanin commentedcommitted this initial doc for hook_system_info_alter to the HEAD and DRUPAL-6--1 developer docs.
Comment #29
drewish commentedI'm committing the attached that backs out NancyDru's addition of hook_get_vocabularies(), hook_get_tree() and hook_get_parents(). As webchick pointed out in #23 those aren't really hooks.
Comment #30
nancydruI wondered about that, but they were on the list. I've also seen people using module_invoke to call them.
Comment #31
Barry Madore commentedComment #32
pwolanin commentedCommitting attached starting docs for hook_action_info() and hook_actions_info_alter(). How frustrating...
Comment #33
lilou commentedComment #34
drewish commentedLooking at webchick's list on #24 and then comparing it to api.dupal.org it looks like the current list really only:
I closed all the other issues.
Comment #35
lilou commentedClose also : #298812: Document hook_action_info_alter()
Comment #36
dave reidhook_translation_link_alter is being addressed in #344661: Document hook_translation_link_alter. Please review.
Comment #37
dave reidWe're down to ONE!
Comment #38
toddy commentedI've just filed #345157: Fix @link syntax in documentation for hook_update_last_removed(). Was this the last undocumented hook?
Comment #39
dave reidIt's actually hook_openid. See #345376: Document missing hook_openid().
Comment #40
dave reid#345376: Document missing hook_openid()
#349469: Document missing hook_node_view_alter()
#364564: Undocumented hook_ranking in search.api.php
Comment #42
dave reidAdded #364564: Undocumented hook_ranking in search.api.php to the list of undocumented hooks in #40.
Comment #43
rfayComment #44
rfayAs far as I can tell, the first two of these 3 are taken care of. I'll look at #364564: Undocumented hook_ranking in search.api.php,
but #345376: Document missing hook_openid() and #349469: Document missing hook_node_view_alter() are dead issues.
Comment #45
rfay#364564: Undocumented hook_ranking in search.api.php is now marked as RTBC, so I'll mark this one fixed.