From 9f6fa37ef79b5bf6fe8ecde4985bd97b4ca0d648 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 21 Mar 2025 02:48:20 +0000 Subject: [PATCH] crash backup --- Controller/ApiController.php | 4 ++-- Controller/BackendController.php | 2 +- Theme/Backend/report-view.tpl.php | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 3f7664f..73dd3fb 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -169,7 +169,7 @@ final class ApiController extends Controller public function apiReportGet(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void { /** @var \Modules\QualityManagement\Models\Report $report */ - $report = ReportMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $report = ReportMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); $this->createStandardReturnResponse($request, $response, $report); } @@ -191,7 +191,7 @@ final class ApiController extends Controller /** @var \Modules\QualityManagement\Models\Report $old */ $old = ReportMapper::get() ->with('task') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) ->execute(); $new = $this->updateReportFromRequest($request, clone $old); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 68f8157..045959a 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -146,7 +146,7 @@ final class BackendController extends Controller ->with('task/attributes/type') ->with('task/attributes/value') ->with('task/for') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) ->where('task/tags/title/language', $request->header->l11n->language) ->execute(); diff --git a/Theme/Backend/report-view.tpl.php b/Theme/Backend/report-view.tpl.php index b1f9f4a..c28aaac 100644 --- a/Theme/Backend/report-view.tpl.php +++ b/Theme/Backend/report-view.tpl.php @@ -66,8 +66,8 @@ echo $this->data['nav']->render(); ?>