Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal-required-modules-320024-D7.patch | 3.81 KB | Dave Reid |
Comments
Comment #1
Dave ReidHoly OMG crap, I think this might work! Just did a test reset and install, and it worked. Patch for review.
Comment #2
Dave ReidMore accurate title. This would be sweet. Ran several installs and tests are passing so far...
Comment #3
webchickThis 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.
Comment #4
webchickI 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?
Comment #5
Dave ReidNaturally, 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. :)
Comment #6
webchickOooookaaayyy. Let's try this. :) Committed to HEAD.
Docs please!
Comment #7
Dave Reidwebchick, 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.
Comment #8
webchickHm. Good point. Let's call this fixed then. :)
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedrequired = 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.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #11
NancyDruHow about Writing .info files (Drupal 7.x)
Comment #12
Dave ReidAdded stuff about required and hidden directives to the handbook page.