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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
3.81 KB

Holy OMG crap, I think this might work! Just did a test reset and install, and it worked. Patch for review.

Dave Reid’s picture

Title: Replace drupal_required_modules with parsing .info files for 'required = TRUE' » Replace hardcoded drupal_required_modules with parsing .info files for 'required = TRUE'

More accurate title. This would be sweet. Ran several installs and tests are passing so far...

webchick’s picture

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.

webchick’s picture

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?

Dave Reid’s picture

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. :)

webchick’s picture

Status: Needs review » Needs work

Oooookaaayyy. Let's try this. :) Committed to HEAD.

Docs please!

Dave Reid’s picture

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.

webchick’s picture

Status: Needs work » Fixed

Hm. Good point. Let's call this fixed then. :)

moshe weitzman’s picture

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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

NancyDru’s picture

Status: Closed (fixed) » Needs work
Issue tags: +Needs documentation
Dave Reid’s picture

Status: Needs work » Fixed

Added stuff about required and hidden directives to the handbook page.

Status: Fixed » Closed (fixed)
Issue tags: -Needs documentation

Automatically closed -- issue fixed for 2 weeks with no activity.