diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-11 03:25:36 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-11 03:25:36 +0000 |
commit | 819b0e95a9f36fbbc51268e82c5df87b2eb5fb67 (patch) | |
tree | 6ede03ab9c6e5ba036347b4acb43839bb27edf28 | |
parent | 240fa1b407af70c45fbc133d815ff894e821777c (diff) | |
download | brdo-819b0e95a9f36fbbc51268e82c5df87b2eb5fb67.tar.gz brdo-819b0e95a9f36fbbc51268e82c5df87b2eb5fb67.tar.bz2 |
#319699 by Dave Reid: Simplify logic for hiding required modules.
-rw-r--r-- | modules/system/system.admin.inc | 5 | ||||
-rw-r--r-- | modules/system/system.test | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 9ef4fcf45..1d37f6b66 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -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']) { diff --git a/modules/system/system.test b/modules/system/system.test index 52c51db72..dc36470e4 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -89,6 +89,18 @@ class EnableDisableCoreTestCase extends DrupalWebTestCase { } /** + * 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. * * @param string $base_table Begginning of table name to look for. |