From fc9d52ba18953c50b9782d0d6dc9cbe958e80c22 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 29 Apr 2025 12:54:52 +0200 Subject: [PATCH] fixed new model classes without model --- application/WarehouseHistory/WarehouseHistoryController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/WarehouseHistory/WarehouseHistoryController.php b/application/WarehouseHistory/WarehouseHistoryController.php index 5691222bf..396efbb39 100644 --- a/application/WarehouseHistory/WarehouseHistoryController.php +++ b/application/WarehouseHistory/WarehouseHistoryController.php @@ -3,7 +3,8 @@ class WarehouseHistoryController { public function create($postData, $mod) { - $modelClass = class_exists($mod . 'Model') ? new ($mod . 'Model')() : new $mod(); + $modelClass = class_exists($mod . 'Model') ? $mod . 'Model' : $mod; + $modelClass = new $modelClass(); $currentData = $modelClass::get($postData['id']); $me = new User(); $me->loadMe();