Skip to content

Commit 270e8fd

Browse files
committed
N°9141 Log when extension uninstallation is forced
1 parent f062972 commit 270e8fd

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

setup/wizardsteps/WizStepInstall.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,30 @@ public function Display(WebPage $oPage)
8383
$oPage->add('<input type="hidden" id="authent_token" value="'.$sAuthentToken.'"/>');
8484
if (!$this->CheckDependencies()) {
8585
$oPage->error($this->sDependencyIssue);
86+
$oPage->add_ready_script(<<<JS
87+
$("#wiz_form").data("installation_status", "error");
88+
document.getElementById("setup_msg").innerText = "Unmet dependencies";
89+
JS);
90+
return;
8691
}
8792

88-
$oPage->add_ready_script(
89-
<<<JS
93+
$aExtensionsRemoved = json_decode($this->oWizard->GetParameter('removed_extensions'), true) ?? [];
94+
$aExtensionsNotUninstallable = json_decode($this->oWizard->GetParameter('extensions_not_uninstallable'));
95+
$aExtensionsForceUninstalled = [];
96+
foreach ($aExtensionsRemoved as $sExtensionCode => $sLabel) {
97+
if (in_array($sExtensionCode, $aExtensionsNotUninstallable)) {
98+
$aExtensionsForceUninstalled[] = $sExtensionCode;
99+
}
100+
}
101+
if (count($aExtensionsForceUninstalled)) {
102+
SetupLog::Info("Extensions uninstalled forcefully : ".implode(',', $aExtensionsForceUninstalled));
103+
}
104+
105+
$oPage->add_ready_script(<<<JS
90106
$("#wiz_form").data("installation_status", "not started");
91107
ExecuteStep("");
92-
JS
93-
);
108+
JS);
109+
94110
}
95111

96112
/**

0 commit comments

Comments
 (0)