Skip to content
Snippets Groups Projects
Commit 819b0e95 authored by Angie Byron's avatar Angie Byron
Browse files

#319699 by Dave Reid: Simplify logic for hiding required modules.

parent 240fa1b4
No related branches found
No related tags found
No related merge requests found
......@@ -645,7 +645,7 @@ function system_modules($form_state = array()) {
$extra = array();
// If the module is requried, set it to be so.
if (in_array($filename, $modules_required)) {
$extra['required'] = TRUE;
continue;
}
$extra['enabled'] = (bool) $module->status;
// If this module has dependencies, add them to the array.
......@@ -689,7 +689,6 @@ function system_modules($form_state = array()) {
'#type' => 'fieldset',
'#title' => t($package),
'#collapsible' => TRUE,
'#access' => ($package != 'Core - required'),
'#theme' => 'system_modules_fieldset',
'#header' => array(
array('data' => t('Enabled'), 'class' => 'checkbox'),
......@@ -722,7 +721,6 @@ function system_sort_modules_by_info_name($a, $b) {
function _system_modules_build_row($info, $extra) {
// Add in the defaults.
$extra += array(
'required' => FALSE,
'dependencies' => array(),
'dependents' => array(),
'disabled' => FALSE,
......@@ -773,7 +771,6 @@ function _system_modules_build_row($info, $extra) {
$form['enable'] = array(
'#type' => 'checkbox',
'#title' => t('Enable'),
'#required' => $extra['required'],
'#default_value' => $extra['enabled'],
);
if ($extra['disabled']) {
......
......@@ -88,6 +88,18 @@ class EnableDisableCoreTestCase extends DrupalWebTestCase {
$this->assertTableCount('locale', TRUE);
}
/**
* Assert that core required modules cannot be disabled.
*/
function testDisableRequired() {
$required_modules = drupal_required_modules();
foreach($required_modules as $module) {
// Check to make sure the checkbox for required module is not found.
$this->drupalGet('admin/build/modules');
$this->assertNoFieldByName('modules[Core][' . $module . '][enable]');
}
}
/**
* Assert tables that begin with the specified base table name.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment