Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
819b0e95
Commit
819b0e95
authored
Oct 11, 2008
by
webchick
Browse files
#319699
by Dave Reid: Simplify logic for hiding required modules.
parent
240fa1b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/system/system.admin.inc
View file @
819b0e95
...
...
@@ -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'
])
{
...
...
modules/system/system.test
View file @
819b0e95
...
...
@@ -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.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment