I just started making use of this API for a D6 test profile and it kicks ass, way to go!
One minor annoyance I found is that I started from the core D6 default.profile file. It contains the following:
function default_profile_modules() {
return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog');
}
I did this (as suggested in the code):
install_include(foo_profile_modules());
After that, none of the required core module include files were loaded (user, system, etc). Seems like install_include() should always include the required core modules, no? I worked-around it by (needlessly) including all of them in foo_profile_modules(), but it seems silly to solve this there.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 337934_auto_load_required_core.2.patch | 1.22 KB | dww |
Comments
Comment #1
boris mann commentedRemember: I code just well enough to make other coders cry and fix my code :P.
Yes, automatically including all the required core modules sounds like the right thing to do. I'd love to think of other smart ways of auto including files as needed, so improvements are obviously welcomed.
Comment #2
dwwA) Seems like in D5, your install profile has to manually handle the required core modules, so this doesn't need a backport since D5 install profiles don't work unless they already specify those.
B) Attached patch for D6 uses drupal_required_modules() and appends that to the list of modules passed in (ensuring uniqueness).
C) While I was at it, fixed a few code style issues -- include_once isn't a function, so the ()s aren't desirable.
D) I find this:
"$path/contrib/$module.inc"much more legible and clear than this:
$path .'/contrib/'. $module .'.inc'Any objections before I commit?
Comment #3
dwwdmitrig01 said this was RTBC, so I committed to DRUPAL-6--1.