From adae35ccc43564d3f2b86369cf6d6302c1c16a3e Mon Sep 17 00:00:00 2001 From: odain Date: Wed, 21 Jan 2026 17:11:11 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B08764=20-=20use=20last=20working=20model?= =?UTF-8?q?=20in=20case=20setup=20wizard=20to=20do=20setup=20audit=20-=20s?= =?UTF-8?q?kip=20if=20no=20model=20available=20to=20make=20setup=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/applicationinstaller.class.inc.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index 94af465216..98b939a3e4 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -517,7 +517,7 @@ class ApplicationInstaller * * @since 3.1.0 N°2013 added the aParamValues param */ - protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bIsSetupDataAuditEnabled, $bUseSymbolicLinks = null) + protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, bool &$bIsSetupDataAuditEnabled, $bUseSymbolicLinks = null) { /** * @since 3.2.0 move the ContextTag init at the very beginning of the method @@ -565,7 +565,7 @@ class ApplicationInstaller $bIsAlreadyInMaintenanceMode = false; } - $this->SaveModelInfo($sEnvironment); + $bIsSetupDataAuditEnabled = $this->SaveModelInfo($sEnvironment); } if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) { @@ -664,11 +664,17 @@ class ApplicationInstaller return APPROOT."data/beforecompilation_".$sEnv."_modelinfo.json"; } - private function SaveModelInfo(string $sEnvironment): void + private function SaveModelInfo(string $sEnvironment): bool { - $aModelInfo = ModelReflectionSerializer::GetInstance()->GetModelFromEnvironment($sEnvironment); $sModelInfoPath = $this->GetModelInfoPath($sEnvironment); - file_put_contents($sModelInfoPath, json_encode($aModelInfo)); + try { + $aModelInfo = ModelReflectionSerializer::GetInstance()->GetModelFromEnvironment($sEnvironment); + } catch (Exception $e){ + //logged already + return is_file($sModelInfoPath); + } + + return (bool) file_put_contents($sModelInfoPath, json_encode($aModelInfo)); } private function GetPreviousModelInfo(string $sEnvironment): array