#997802 by David_Rothstein, dww: Fixed Update manager doesn't allow you to install a project if it finds a single 'broken' module in it
parent
64da40b93f
commit
1b75281915
|
@ -649,11 +649,9 @@ function theme_update_last_check($variables) {
|
||||||
* First, we ensure that the archive isn't a copy of Drupal core, which the
|
* First, we ensure that the archive isn't a copy of Drupal core, which the
|
||||||
* Update manager does not yet support. @see http://drupal.org/node/606592
|
* Update manager does not yet support. @see http://drupal.org/node/606592
|
||||||
*
|
*
|
||||||
* Then, we make sure that every module included in the archive has an info
|
* Then, we make sure that at least one module included in the archive file has
|
||||||
* file.
|
* an .info file which claims that the code is compatible with the current
|
||||||
*
|
* version of Drupal core.
|
||||||
* Finally, we check that all the .info files claim the code is compatible
|
|
||||||
* with the current version of Drupal core.
|
|
||||||
*
|
*
|
||||||
* @see drupal_system_listing()
|
* @see drupal_system_listing()
|
||||||
* @see _system_rebuild_module_data()
|
* @see _system_rebuild_module_data()
|
||||||
|
@ -674,27 +672,12 @@ function update_verify_update_archive($project, $archive_file, $directory) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for any .module file that doesn't have a corresponding .info file.
|
// Parse all the .info files and make sure at least one is compatible with
|
||||||
$missing_info = array();
|
// this version of Drupal core. If one is compatible, then the project as a
|
||||||
$files = file_scan_directory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.module$/', array('key' => 'name', 'min_depth' => 0));
|
// whole is considered compatible (since, for example, the project may ship
|
||||||
foreach ($files as $key => $file) {
|
// with some out-of-date modules that are not necessary for its overall
|
||||||
// If it has no info file, set an error.
|
// functionality).
|
||||||
$info_file = dirname($file->uri) . '/' . $file->name . '.info';
|
$compatible_project = FALSE;
|
||||||
if (!file_exists($info_file)) {
|
|
||||||
$missing_info[] = $file->filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!empty($missing_info)) {
|
|
||||||
$errors[] = format_plural(
|
|
||||||
count($missing_info),
|
|
||||||
'%archive_file contains %names which is missing an info file.',
|
|
||||||
'%archive_file contains the following modules which are missing info files: %names',
|
|
||||||
array('%archive_file' => basename($archive_file), '%names' => implode(', ', $missing_info))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse all the .info files and make sure they're compatible with this
|
|
||||||
// version of Drupal core.
|
|
||||||
$incompatible = array();
|
$incompatible = array();
|
||||||
$files = file_scan_directory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', array('key' => 'name', 'min_depth' => 0));
|
$files = file_scan_directory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', array('key' => 'name', 'min_depth' => 0));
|
||||||
foreach ($files as $key => $file) {
|
foreach ($files as $key => $file) {
|
||||||
|
@ -705,8 +688,16 @@ function update_verify_update_archive($project, $archive_file, $directory) {
|
||||||
if (empty($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) {
|
if (empty($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) {
|
||||||
$incompatible[] = !empty($info['name']) ? $info['name'] : t('Unknown');
|
$incompatible[] = !empty($info['name']) ? $info['name'] : t('Unknown');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$compatible_project = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($incompatible)) {
|
|
||||||
|
if (empty($files)) {
|
||||||
|
$errors[] = t('%archive_file does not contain any .info files.', array('%archive_file' => basename($archive_file)));
|
||||||
|
}
|
||||||
|
elseif (!$compatible_project) {
|
||||||
$errors[] = format_plural(
|
$errors[] = format_plural(
|
||||||
count($incompatible),
|
count($incompatible),
|
||||||
'%archive_file contains a version of %names that is not compatible with Drupal !version.',
|
'%archive_file contains a version of %names that is not compatible with Drupal !version.',
|
||||||
|
|
Loading…
Reference in New Issue