N°9009 - fix removing sources of a mandatory module

This commit is contained in:
Eric Espie
2026-04-30 12:03:38 +02:00
parent c4eaeeeb5f
commit da282e6c24
2 changed files with 38 additions and 5 deletions

View File

@@ -478,6 +478,7 @@ EOF
* @param string $sParentId Used for recursion
*
* @return string A text representation of what will be installed
* @throws \Exception
*/
public function GetSelectedModules($aInfo, $aSelectedChoices, &$aModules, $sParentId = '', $sDisplayChoices = '', &$aSelectedExtensions = null)
{
@@ -507,8 +508,8 @@ EOF
(isset($aSelectedChoices[$sChoiceId]) && ($aSelectedChoices[$sChoiceId] == $sChoiceId))) {
$sDisplayChoices .= '<li>'.$aChoice['title'].'</li>';
if (isset($aChoice['modules'])) {
if (count($aChoice['modules']) === 0) {
//throw new Exception('Extension '.$aChoice['extension_code'].' does not have any module associated');
if (count($aChoice['modules']) === 0 && (!isset($aChoice['missing']) || $aChoice['missing'] === false)) {
throw new Exception('Extension '.$aChoice['extension_code'].' does not have any module associated');
}
foreach ($aChoice['modules'] as $sModuleId) {
$bSelected = true;