From 9d5f669d58e343423318082cf7dd93b2376d640f Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 21 Mar 2025 02:48:19 +0000 Subject: [PATCH] crash backup --- Controller/ApiAttributeController.php | 20 ++++++++++---------- Controller/BackendController.php | 4 ++-- info.json | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index 11ff49e..f1c2438 100644 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -243,7 +243,7 @@ final class ApiAttributeController extends Controller ->with('type') ->with('type/defaults') ->with('value') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) ->execute(); $new = $this->updateAttributeFromRequest($request, clone $old); @@ -291,7 +291,7 @@ final class ApiAttributeController extends Controller $optionAttribute = InvestmentObjectAttributeMapper::get() ->with('type') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) ->execute(); if ($optionAttribute->type->isRequired) { @@ -327,7 +327,7 @@ final class ApiAttributeController extends Controller } /** @var BaseStringL11n $old */ - $old = InvestmentObjectAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $old = InvestmentObjectAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); $new = $this->updateAttributeTypeL11nFromRequest($request, clone $old); $this->updateModel($request->header->account, $old, $new, InvestmentObjectAttributeTypeL11nMapper::class, 'option_attribute_type_l11n', $request->getOrigin()); @@ -357,7 +357,7 @@ final class ApiAttributeController extends Controller } /** @var BaseStringL11n $optionAttributeTypeL11n */ - $optionAttributeTypeL11n = InvestmentObjectAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $optionAttributeTypeL11n = InvestmentObjectAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); $this->deleteModel($request->header->account, $optionAttributeTypeL11n, InvestmentObjectAttributeTypeL11nMapper::class, 'option_attribute_type_l11n', $request->getOrigin()); $this->createStandardDeleteResponse($request, $response, $optionAttributeTypeL11n); } @@ -385,7 +385,7 @@ final class ApiAttributeController extends Controller } /** @var AttributeType $old */ - $old = InvestmentObjectAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); + $old = InvestmentObjectAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute(); $new = $this->updateAttributeTypeFromRequest($request, clone $old); $this->updateModel($request->header->account, $old, $new, InvestmentObjectAttributeTypeMapper::class, 'option_attribute_type', $request->getOrigin()); @@ -417,7 +417,7 @@ final class ApiAttributeController extends Controller } /** @var AttributeType $optionAttributeType */ - $optionAttributeType = InvestmentObjectAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); + $optionAttributeType = InvestmentObjectAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute(); $this->deleteModel($request->header->account, $optionAttributeType, InvestmentObjectAttributeTypeMapper::class, 'option_attribute_type', $request->getOrigin()); $this->createStandardDeleteResponse($request, $response, $optionAttributeType); } @@ -445,7 +445,7 @@ final class ApiAttributeController extends Controller } /** @var AttributeValue $old */ - $old = InvestmentObjectAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $old = InvestmentObjectAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); /** @var \Modules\Attribute\Models\Attribute $attr */ $attr = InvestmentObjectAttributeMapper::get() @@ -485,7 +485,7 @@ final class ApiAttributeController extends Controller // } // /** @var \Modules\InvestmentManagement\Models\InvestmentObjectAttributeValue $optionAttributeValue */ - // $optionAttributeValue = InvestmentObjectAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute(); + // $optionAttributeValue = InvestmentObjectAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); // $this->deleteModel($request->header->account, $optionAttributeValue, InvestmentObjectAttributeValueMapper::class, 'option_attribute_value', $request->getOrigin()); // $this->createStandardDeleteResponse($request, $response, $optionAttributeValue); } @@ -513,7 +513,7 @@ final class ApiAttributeController extends Controller } /** @var BaseStringL11n $old */ - $old = InvestmentObjectAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id')); + $old = InvestmentObjectAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0); $new = $this->updateAttributeValueL11nFromRequest($request, clone $old); $this->updateModel($request->header->account, $old, $new, InvestmentObjectAttributeValueL11nMapper::class, 'option_attribute_value_l11n', $request->getOrigin()); @@ -543,7 +543,7 @@ final class ApiAttributeController extends Controller } /** @var BaseStringL11n $optionAttributeValueL11n */ - $optionAttributeValueL11n = InvestmentObjectAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $optionAttributeValueL11n = InvestmentObjectAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute(); $this->deleteModel($request->header->account, $optionAttributeValueL11n, InvestmentObjectAttributeValueL11nMapper::class, 'option_attribute_value_l11n', $request->getOrigin()); $this->createStandardDeleteResponse($request, $response, $optionAttributeValueL11n); } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 547821b..a9c2c4b 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -148,7 +148,7 @@ final class BackendController extends Controller ->with('options/attributes/type') ->with('options/attributes/type/l11n') ->with('options/attributes/value') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) //->where('options/attributes/type/l11n/language', $response->header->l11n->language) ->execute(); @@ -245,7 +245,7 @@ final class BackendController extends Controller ->with('attributes/type/l11n') ->with('attributes/value') ->with('attributes/value/l11n') - ->where('id', (int) $request->getData('id')) + ->where('id', $request->getDataInt('id') ?? 0) ->where('attributes/type/l11n/language', $response->header->l11n->language) ->where('attributes/value/l11n/language', [$response->header->l11n->language, null]) ->execute(); diff --git a/info.json b/info.json index 7d13d51..761d631 100755 --- a/info.json +++ b/info.json @@ -19,7 +19,8 @@ "dependencies": { "Finance": "*", "SupplierManagement": "*", - "ItemManagement": "*" + "ItemManagement": "*", + "Workflow": "*" }, "providing": { "Navigation": "*"