N°8912 - Cannot work on a licence with legacy extensions including modules without explicit version

This commit is contained in:
odain
2025-11-13 11:13:33 +01:00
parent 5045ec4afa
commit b5c79e1d75
2 changed files with 60 additions and 17 deletions

View File

@@ -120,10 +120,6 @@ class ModuleDiscovery
$aArgs['module_file'] = $sFilePath;
list($sModuleName, $sModuleVersion) = static::GetModuleName($sId);
if ($sModuleVersion == '')
{
$sModuleVersion = '1.0.0';
}
if (array_key_exists($sModuleName, self::$m_aModuleVersionByName))
{
@@ -233,7 +229,7 @@ class ModuleDiscovery
}
ksort($aDependencies);
$aOrderedModules = [];
$iLoopCount = 1;
$iLoopCount = 0;
while(($iLoopCount < count($aModules)) && (count($aDependencies) > 0) )
{
foreach($aDependencies as $sId => $aRemainingDeps)
@@ -308,16 +304,8 @@ class ModuleDiscovery
// Separate the module names from their version for an easier comparison later
foreach($aOrderedModules as $sModuleId)
{
$aMatches = array();
if (preg_match('|^([^/]+)/(.*)$|', $sModuleId, $aMatches))
{
$aModuleVersions[$aMatches[1]] = $aMatches[2];
}
else
{
// No version number found, assume 1.0.0
$aModuleVersions[$sModuleId] = '1.0.0';
}
list($sModuleName, $sVersion) = self::GetModuleName($sModuleId);
$aModuleVersions[$sModuleName] = $sVersion;
}
if (preg_match_all('/([^\(\)&| ]+)/', $sDepString, $aMatches))
{
@@ -456,13 +444,17 @@ class ModuleDiscovery
{
$sName = $aMatches[1];
$sVersion = $aMatches[2];
if ($sVersion === ""){
$sVersion = "1.0.0";
}
}
else
{
$sName = $sModuleId;
$sVersion = "";
$sVersion = "1.0.0";
}
return array($sName, $sVersion);
return [$sName, $sVersion];
}
/**