Replace hardcoded drupal_required_modules with parsing .info files for 'required = TRUE'
Dave Reid - October 11, 2008 - 18:02
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | install system |
| Category: | task |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | needs work |
| Issue tags: | Needs Documentation |
Description
Taking the dicussion from #319699: Simplify required module hiding in admin/build/modules. We should probably have 'required = TRUE' and not 'hidden = TRUE' so that we can possibly replace the stupid drupal_required_modules function.

#1
Holy OMG crap, I think this might work! Just did a test reset and install, and it worked. Patch for review.
#2
More accurate title. This would be sweet. Ran several installs and tests are passing so far...
#3
This is a nice improvement, and I'd like to get this in, but I'd also like someone else's eyes on it first, since I was part of the original group talking about this.
#4
I should mention, one particular concern I have is with required modules that have dependencies. For example, if Module A has direct function calls in it to Module B, esp. in its hook_install(). Module A is earlier in the alphabet, therefore Module B is not enabled at this time. All hell breaks loose?
#5
Naturally, that's what would happen normally. The current function actually gets the required modules in the same order as the hard-coded array. I'd say in that case, that's a perfect use case for hook_modules_installed. :)
#6
Oooookaaayyy. Let's try this. :) Committed to HEAD.
Docs please!
#7
webchick, what and where would you like me to document? I could improve the PHPdoc of drupal_required_modules a little better, but how should we go about letting people know that hidden = TRUE and required = TRUE can be set in .info files? Using those parameters needs to be used with caution. Really the only case for using required = TRUE is a pre-packaged Drupal and should not in any way be used by any contrib modules.
#8
Hm. Good point. Let's call this fixed then. :)
#9
required = TRUE for seems quite useful for custom modules that a site depends on - e.g. client_foo.module. i agree it makes little sense for contrib.
--project followup subject--
Automatically closed -- issue fixed for two weeks with no activity.
#10
Automatically closed -- issue fixed for two weeks with no activity.
#11
How about Writing .info files (Drupal 7.x)