Problem/Motivation
Early on, ModuleInstaller::install() has a check for sanity in the requested module list:
$module_data = \Drupal::service('extension.list.module')->reset()->getList();
foreach ($module_list as $module) {
if (!empty($module_data[$module]->info['core_incompatible'])) {
throw new MissingDependencyException("Unable to install modules: module '$module' is incompatible with this version of Drupal core.");
}
ETC
However, the check for a module that doesn't exist only happens if $enable_dependencies is TRUE:
if ($enable_dependencies) {
$module_list = $module_list ? array_combine($module_list, $module_list) : [];
if ($missing_modules = array_diff_key($module_list, $module_data)) {
// One or more of the given modules doesn't exist.
throw new MissingDependencyException(sprintf('Unable to install modules %s due to missing modules %s.', implode(', ', $module_list), implode(', ', $missing_modules)));
}
Steps to reproduce
Proposed resolution
Move the check to the earlier loop and convert it to an `isset($module_data[$module])
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
ishani patel commentedComment #4
ishani patel commentedHello
I've updated the changes for the non-existent module.
Raised MR for that. Kindly review it.
Thanks!
Comment #5
joachim commentedLooks good. Thanks!