Required modules for profile

Events happening in the community are now at Drupal community events on www.drupal.org.
Amazon's picture

In System.module there is an array with required modules.

// Merge in required modules. $modules_required = array('block', 'filter', 'node', 'system', 'user', 'watchdog');
foreach ($modules_required as $required) {
$disabled[] = $required;
$form['disabled_modules']['#value'][$required] = TRUE;
}

However, when I add modules I want to be required, they do not appear as core required modules, in the modules page.

Any ideas how to require modules in a profile?

Comments

Just list them

boris mann's picture

They will never show up in Core - Required, if that's what you mean. Anything you put in profilename_profile_modules() will be required, and the install won't proceed if there are any missing modules.

Now, if you mean "don't allow them to be disabled", this is something that can be set in settings.php. Adrian long ago made a patch that would reflect in the UI that this is something that can't be toggled (i.e. gray out the control and make help tip that mentions that this is an override) but it never got in.

Example of required modules in settings.php

Amazon's picture

Got an example of required modules in settings.php? It appears that most settings.php variables are from the variables table, not the system table.

Yes, I'd like for the module to show up in the GUI but not be able to be disabled. When I list the required modules, I can still disable them in the modules page. I suspect the function above it for bootstrap and not for runtime.

An example module would be to require the Paranoia module.

Kieran

To seek, to strive, to find, and not to yield

New Drupal career! Drupal profile builders.
Try pre-configured and updatable profiles on CivicSpaceOnDemand

Just make it enabled

boris mann's picture

Setting a module to enabled in settings.php keeps it always enabled.

I'll get Adrian to dig up the pointer to the patch...

Distributions

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: