Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Mar 2012 at 09:52 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gábor hojtsyComment #2
webchickSwitching components so this gets onto Jennifer's radar.
Comment #3
gábor hojtsy@webchick: thanks!
In fact, we should not only remove the parts that were already moved to language.api.php but move the rest too. language.module is the base language management UI so language.api.php is the place for all base language API docs. The hooks documented here are not in fact part of either language module or locale module, they are part of the language base system (housed on bootstrap.inc and language.inc), but we don't really have a better place to document these hooks.
Since there are no locale hooks documented whatsoever, this effectively removes locale.api.php.
Note that I made no changes to the docs in any way. I just copy-pasted. The hooks are already all hook_language_*().
Comment #4
jhodgdonHmm. Normally we only put hooks in a modules/xyz/xyz.api.php if the hooks are actually part of that module.
Other hooks should go into modules/system somewhere by convention. Perhaps we need a modules/system/language.api.php file to house hooks that are not really part of language.module but really part of the base language system? Otherwise if there are just a few, they can go into system.api.php itself.
Comment #5
gábor hojtsyOk retitled for the base problem of the issue :) So we have these in locale.api.php:
All these are invoked only from the base include files of bootstrap.inc and language.inc, in order:
Therefore we can conclude all those hooks are defined by the base system as per your grouping and should go to system.module. I think these are numerous enough to warrant their own file.
The rest of the hooks documented in locale.api.php are all hook_locale_language_*() which since been all moved to language.api.php and renamed to hook_language_*(). All of those are new to D8.
This makes locale.api.php disappear with items removed and moving to language.api.php in system module. I *did not* make any changes to the docs themselves. Just modified the @file header to properly explain what hooks are these.
Comment #6
gábor hojtsyComment #7
jhodgdonThat sounds like the right fix. I'll get it committed.
Comment #8
catchFor a follow-up maybe since api module scans these files wherever they are, could we not do something like includes/api and put various *.api.php files in there? That would then cover any hook that's not invoked by a module, and we could keep system module out of it.
Comment #9
jhodgdonI suppose we could move a lot of the hooks that are in modules/system/*.api.php into that proposed includes directory -- I think most of the ones even in system.api.php are not really system.module functionality. Sounds like a reasonable idea, but a separate issue?
Comment #10
jhodgdonMeanwhile, I've committed this patch. I guess it's 8.x only...
Comment #11
gábor hojtsyThanks, http://api.drupal.org/api/drupal/modules%21locale%21locale.api.php/7 also has lots of system level hooks documented. The last two are D7 hooks (the first before the last one was removed entirely in D8 and the last one was replaced by more general hooks). So I think this would apply to D7 if we want to clean up API docs placement there too. Feel free to move back to D8 fixed if that is not the case.
Comment #12
jhodgdonSounds like a good plan. A straight backport of the above patch wouldn't work, but yes we could move a bunch of the hooks into a new file like in the d8 patch.
Comment #13
gábor hojtsyOk, here is a D7 version. Because D7 does have two hooks from locale module, locale.api.php is kept with those.
Comment #14
jhodgdonLooks good to me. Committed to 7.x