Commit 390e2fd2 authored by webchick's avatar webchick

#320024 by Dave Reid: Replace hardcoded drupal_required_modules() with...

#320024 by Dave Reid: Replace hardcoded drupal_required_modules() with required = TRUE in .info files.
parent 72bbd21e
......@@ -492,5 +492,13 @@ function module_invoke_all() {
* Array of modules required by core.
*/
function drupal_required_modules() {
return array('block', 'filter', 'node', 'system', 'user');
$files = drupal_system_listing('/\.info$/', 'modules', 'name', 0);
$required = array();
foreach ($files as $name => $file) {
$info = drupal_parse_info_file($file->filename);
if (!empty($info) && !empty($info['required']) && $info['required']) {
$required[] = $name;
}
}
return $required;
}
......@@ -8,4 +8,4 @@ core = 7.x
files[] = block.module
files[] = block.admin.inc
files[] = block.install
hidden = TRUE
required = TRUE
......@@ -8,4 +8,4 @@ files[] = filter.module
files[] = filter.admin.inc
files[] = filter.pages.inc
files[] = filter.install
hidden = TRUE
required = TRUE
......@@ -9,4 +9,4 @@ files[] = content_types.inc
files[] = node.admin.inc
files[] = node.pages.inc
files[] = node.install
hidden = TRUE
required = TRUE
......@@ -616,7 +616,7 @@ function system_modules($form_state = array()) {
// Remove hidden modules from display list.
foreach ($files as $filename => $file) {
if (!empty($file->info['hidden'])) {
if (!empty($file->info['hidden']) || !empty($file->info['required'])) {
unset($files[$filename]);
}
}
......
......@@ -8,4 +8,4 @@ files[] = system.module
files[] = system.admin.inc
files[] = image.gd.inc
files[] = system.install
hidden = TRUE
required = TRUE
......@@ -8,4 +8,4 @@ files[] = user.module
files[] = user.admin.inc
files[] = user.pages.inc
files[] = user.install
hidden = TRUE
required = TRUE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment