Skip to content

Commit 1102698

Browse files
committed
fix: can not load and install modules and dependencies
1 parent 5d895e0 commit 1102698

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/Classes/Controllers/IndexController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ public function invokeLoadAndInstall()
594594
}
595595

596596
$moduleLoader = LocalModuleLoader::createFromConfig();
597+
$moduleLoader->resetCache();
597598
$module = $moduleLoader->loadByArchiveNameAndVersion($archiveName, $version);
598599

599600
if (!$module) {

src/Classes/ModuleInstaller.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ private function internalPullAndInstall(Module $module): void
220220
$this->pull($module);
221221
}
222222

223-
$reloaded = $this->reload($module);
223+
$reloadedModule = $this->reload($module);
224224

225-
if (!$reloaded->isLoaded()) {
225+
if (!$reloadedModule || !$reloadedModule->isLoaded()) {
226226
$message =
227227
"Can not pull and install module {$module->getArchiveName()} {$module->getVersion()}. "
228228
. "Module is not loaded.";
@@ -231,12 +231,12 @@ private function internalPullAndInstall(Module $module): void
231231
throw new RuntimeException($message);
232232
}
233233

234-
if ($reloaded->isInstalled()) {
234+
if ($reloadedModule->isInstalled()) {
235235
return;
236236
}
237237

238-
$this->uninstall($module);
239-
$this->internalInstall($module);
238+
$this->uninstall($reloadedModule);
239+
$this->internalInstall($reloadedModule);
240240
}
241241

242242
private function internalInstallDependencies(Module $parentModule, Combination $combination): void

0 commit comments

Comments
 (0)