N°8772 - WIP dependencies - Does not work yet

This commit is contained in:
Eric Espie
2025-11-04 15:22:14 +01:00
parent 5a1f6ffde9
commit a092b65be7
14 changed files with 245 additions and 96 deletions

View File

@@ -527,7 +527,7 @@ abstract class Controller extends AbstractController
if (is_null($aErrors) || count($aErrors) === 0) {
$aErrors[self::TWIG_ERROR] = "Missing TWIG template for $sTemplateName";
}
IssueLog::Error(implode("\n",$aErrors[self::TWIG_ERROR] ?? [])."\n".implode("\n",$aErrors[self::TWIG_WARNING] ?? []));
IssueLog::Error(implode("\n", $aErrors[self::TWIG_ERROR] ?? [])."\n".implode("\n", $aErrors[self::TWIG_WARNING] ?? []));
} else {
// Ignore warnings
$aErrors[self::TWIG_WARNING] = [];
@@ -828,14 +828,16 @@ abstract class Controller extends AbstractController
catch (SyntaxError $e) {
IssueLog::Error($e->getMessage().' - file: '.$e->getFile().'('.$e->getLine().')');
$aErrors[self::TWIG_ERROR][] = $e->getMessage();
return false;
return '';
}
catch (Exception $e) {
$sExceptionMessage = $e->getMessage();
if (str_contains($sExceptionMessage, 'at line')) {
IssueLog::Error($sExceptionMessage);
$aErrors[self::TWIG_ERROR][] = $sExceptionMessage;
return false;
return '';
}
if (!str_contains($sExceptionMessage, 'Unable to find template')) {
IssueLog::Error($sExceptionMessage);
@@ -1063,6 +1065,8 @@ abstract class Controller extends AbstractController
if ($this->sPageType === self::ENUM_PAGE_TYPE_TURBO_FORM_AJAX) {
$this->AddToPage($this->oTwig->render('application/forms/itop_error_update.html.twig', ['sControllerError' => $sErrorMsg]));
return;
}
$this->AddToPage($this->oTwig->render('application/forms/itop_error.html.twig', ['sControllerError' => $sErrorMsg]));