Selaa lähdekoodia

Setup: added detailed reporting on the data model validation issues

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1953 a333f486-631f-4898-b8df-5754b55c2be0
romainq 13 vuotta sitten
vanhempi
commit
bf2ac9f8f6
1 muutettua tiedostoa jossa 18 lisäystä ja 4 poistoa
  1. 18 4
      setup/ajax.dataloader.php

+ 18 - 4
setup/ajax.dataloader.php

@@ -188,10 +188,24 @@ try
 			}
 		}
 		//$oFactory->Dump();
-		
-		$oMFCompiler = new MFCompiler($oFactory, $sSourcePath);
-		$oMFCompiler->Compile($sTargetPath);
-		SetupPage::log_info("Data model successfully compiled to '$sTargetPath'.");
+		if ($oFactory->HasLoadErrors())
+		{
+			foreach($oFactory->GetLoadErrors() as $sModuleId => $aErrors)
+			{
+				SetupPage::log_error("Data model source file (xml) could not be loaded - found errors in module: $sModuleId");
+				foreach($aErrors as $oXmlError)
+				{
+					SetupPage::log_error("Load error: File: ".$oXmlError->file." Line:".$oXmlError->line." Message:".$oXmlError->message);
+				}
+			}
+			throw new Exception("The data model could not be compiled. Please check the setup error log");
+		}
+		else
+		{
+			$oMFCompiler = new MFCompiler($oFactory, $sSourcePath);
+			$oMFCompiler->Compile($sTargetPath);
+			SetupPage::log_info("Data model successfully compiled to '$sTargetPath'.");
+		}
 		break;
 		
 		//////////////////////////////