From 2147ae9105f3d3255e4b0dbfe0c33de505175041 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 11 Sep 2024 17:24:08 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B07802=20-=20MTP=20from=20itophub/designer?= =?UTF-8?q?=20failing=20in=20itop=203.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datamodels/2.x/itop-hub-connector/ajax.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/datamodels/2.x/itop-hub-connector/ajax.php b/datamodels/2.x/itop-hub-connector/ajax.php index 826713274..415c0d710 100644 --- a/datamodels/2.x/itop-hub-connector/ajax.php +++ b/datamodels/2.x/itop-hub-connector/ajax.php @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -use Combodo\iTop\Application\WebPage\AjaxPage; +use Combodo\iTop\Application\WebPage\JsonPage; require_once(APPROOT.'application/utils.inc.php'); require_once(APPROOT.'core/log.class.inc.php'); @@ -110,14 +110,15 @@ function DoBackup($sTargetFile) */ function ReportStatus($sMessage, $bSuccess, $iErrorCode = 0, $aMoreFields = array()) { - $oPage = new AjaxPage(""); - $oPage->SetContentType('application/json'); + // Do not use AjaxPage during setup phases, because it uses InterfaceDiscovery in Twig compilation + $oPage = new JsonPage(); $aResult = array( 'code' => $iErrorCode, 'message' => $sMessage, 'fields' => $aMoreFields ); - $oPage->add(json_encode($aResult)); + $oPage->SetData($aResult); + $oPage->SetOutputDataOnly(true); $oPage->output(); }