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

Dave Reid - October 11, 2008 - 18:20
Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
drupal-required-modules-320024-D7.patch3.81 KBIgnoredNoneNone

#2

Dave Reid - October 11, 2008 - 18:27
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...

#3

webchick - October 12, 2008 - 00:42

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

webchick - October 12, 2008 - 00:44

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

Dave Reid - October 12, 2008 - 00:48

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

webchick - October 12, 2008 - 01:22
Status:needs review» needs work

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

Docs please!

#7

Dave Reid - October 12, 2008 - 03:00

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

webchick - October 12, 2008 - 03:00
Status:needs work» fixed

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

#9

moshe weitzman - October 12, 2008 - 04:26

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--

Anonymous (not verified) - October 26, 2008 - 04:28

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

#10

Anonymous (not verified) - October 26, 2008 - 04:33
Status:fixed» closed

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

#11

NancyDru - October 7, 2009 - 13:15
Status:closed» needs work

How about Writing .info files (Drupal 7.x)

 
 

Drupal is a registered trademark of Dries Buytaert.