From f2993f7c0f096181eda79425e06007e11182b1be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 19:54:57 +0200 Subject: [PATCH] Better fix for #22589 --- htdocs/product/stock/class/mouvementstock.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index b1e184c3fe2..282f09e276e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -976,11 +976,10 @@ class MouvementStock extends CommonObject if ($origin_type) { // Separate originetype with "@" : left part is class name, right part is module name $origin_type_array = explode('@', $origin_type); - $classname = strtolower($origin_type_array[0]); - $modulename = empty($origin_type_array[1]) ? $classname : $origin_type_array[1]; + $classname = ucfirst($origin_type_array[0]); + $modulename = empty($origin_type_array[1]) ? strtolower($classname) : $origin_type_array[1]; $result = dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php'); if ($result) { - $classname = ucfirst($classname); $origin = new $classname($this->db); } }