File tree 1 file changed +5
-4
lines changed
datamodels/2.x/itop-hub-connector
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 23
23
* @license http://opensource.org/licenses/AGPL-3.0
24
24
*/
25
25
26
- use Combodo \iTop \Application \WebPage \AjaxPage ;
26
+ use Combodo \iTop \Application \WebPage \JsonPage ;
27
27
28
28
require_once (APPROOT .'application/utils.inc.php ' );
29
29
require_once (APPROOT .'core/log.class.inc.php ' );
@@ -110,14 +110,15 @@ function DoBackup($sTargetFile)
110
110
*/
111
111
function ReportStatus ($ sMessage , $ bSuccess , $ iErrorCode = 0 , $ aMoreFields = array ())
112
112
{
113
- $ oPage = new AjaxPage ( "" );
114
- $ oPage-> SetContentType ( ' application/json ' );
113
+ // Do not use AjaxPage during setup phases, because it uses InterfaceDiscovery in Twig compilation
114
+ $ oPage = new JsonPage ( );
115
115
$ aResult = array (
116
116
'code ' => $ iErrorCode ,
117
117
'message ' => $ sMessage ,
118
118
'fields ' => $ aMoreFields
119
119
);
120
- $ oPage ->add (json_encode ($ aResult ));
120
+ $ oPage ->SetData ($ aResult );
121
+ $ oPage ->SetOutputDataOnly (true );
121
122
$ oPage ->output ();
122
123
}
123
124
You can’t perform that action at this time.
0 commit comments