commit 6895c34217bd29e6650e07dc6cdf9f5e22d424e2
parent 1ad61bd64725041de9ae28b6699dd0c14d72dc59
Author: dankert <openrat@jandankert.de>
Date: Mon, 14 Feb 2022 00:01:10 +0100
Fix: UI needs output data "_token" and "_id".
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/modules/cms/action/Response.class.php b/modules/cms/action/Response.class.php
@@ -40,10 +40,7 @@ class Response
public function getOutputData()
{
return [
- 'output' => $this->output + [
- '_token' => Session::token(),
- //'_id' => $this->request->id,
- ],
+ 'output' => $this->output,
'notices' => $this->notices, // notices
'errors' => $this->errors, // fieldnames with validation errors
'status' => $this->status, // notice status
diff --git a/modules/cms/output/UIOutput.class.php b/modules/cms/output/UIOutput.class.php
@@ -16,7 +16,7 @@ use \util\exception\ObjectNotFoundException;
use util\exception\UIException;
use util\exception\SecurityException;
use template_engine\engine\TemplateEngine;
-use util\text\TextMessage;
+use util\Session;use util\text\TextMessage;
/**
@@ -67,6 +67,11 @@ class UIOutput extends BaseOutput
*/
private static function outputTemplate($request, $action, $subaction, $outputData)
{
+ $outputData += [
+ '_id' => $request->id,
+ '_token' => Session::token(),
+ ];
+
$templateFile = Startup::MODULE_DIR . 'cms/ui/themes/default/html/views/' . $action.'/'.$subaction . '.php';
if ( DEVELOPMENT )