From 17d7a9dc7bee1480005e5e66b31e5c5077a6f0ff Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 21 Jun 2022 12:28:54 +0200 Subject: [PATCH] minor change in Contract --- Layout/default/Contract/Form.php | 10 +++++----- application/Contract/ContractController.php | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Layout/default/Contract/Form.php b/Layout/default/Contract/Form.php index 0b5a4d714..d3703e3b4 100644 --- a/Layout/default/Contract/Form.php +++ b/Layout/default/Contract/Form.php @@ -166,11 +166,11 @@
diff --git a/application/Contract/ContractController.php b/application/Contract/ContractController.php index 6ab6b9345..2069beb4c 100644 --- a/application/Contract/ContractController.php +++ b/application/Contract/ContractController.php @@ -61,7 +61,19 @@ class ContractController extends mfBaseController { } protected function editAction() { + $id = $this->request->id; + if(!is_numeric($id) || !$id) { + $this->layout()->setFlash("Vertrag nicht gefunden", "error"); + $this->redirect("Contract"); + } + $contract = new Contract($id); + if(!$contract->id) { + $this->layout()->setFlash("Vertrag nicht gefunden", "error"); + $this->redirect("Contract"); + } + + $this->layout()->set("contract", $contract); return $this->addAction(); }