#320024 by Dave Reid: Replace hardcoded drupal_required_modules() with required = TRUE in .info files.

merge-requests/26/head
Angie Byron 2008-10-12 01:23:07 +00:00
parent 72bbd21e5c
commit 390e2fd2d7
7 changed files with 15 additions and 7 deletions

View File

@ -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;
}

View File

@ -8,4 +8,4 @@ core = 7.x
files[] = block.module
files[] = block.admin.inc
files[] = block.install
hidden = TRUE
required = TRUE

View File

@ -8,4 +8,4 @@ files[] = filter.module
files[] = filter.admin.inc
files[] = filter.pages.inc
files[] = filter.install
hidden = TRUE
required = TRUE

View File

@ -9,4 +9,4 @@ files[] = content_types.inc
files[] = node.admin.inc
files[] = node.pages.inc
files[] = node.install
hidden = TRUE
required = TRUE

View File

@ -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]);
}
}

View File

@ -8,4 +8,4 @@ files[] = system.module
files[] = system.admin.inc
files[] = image.gd.inc
files[] = system.install
hidden = TRUE
required = TRUE

View File

@ -8,4 +8,4 @@ files[] = user.module
files[] = user.admin.inc
files[] = user.pages.inc
files[] = user.install
hidden = TRUE
required = TRUE