Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
819b0e95
Commit
819b0e95
authored
16 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#319699
by Dave Reid: Simplify logic for hiding required modules.
parent
240fa1b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/system/system.admin.inc
+1
-4
1 addition, 4 deletions
modules/system/system.admin.inc
modules/system/system.test
+12
-0
12 additions, 0 deletions
modules/system/system.test
with
13 additions
and
4 deletions
modules/system/system.admin.inc
+
1
−
4
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'
])
{
...
...
This diff is collapsed.
Click to expand it.
modules/system/system.test
+
12
−
0
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.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment