From ef802d426ed27e1ac865ea57c6e277c8f9ea0850 Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Tue, 11 Feb 2025 15:44:46 +0100 Subject: [PATCH] not enough test can be a problem with objects who don't have required socid Furthermore it is impossible to unset a property : https://www.php.net/manual/en/function.property-exists.php#116824 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b8b04f032aa..53a60c21064 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5387,7 +5387,7 @@ abstract class CommonObject // Define output language and label if (getDolGlobalInt('MAIN_MULTILANGS')) { - if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { + if (property_exists($this, 'socid') && !empty($this->socid) && !is_object($this->thirdparty)) { dol_print_error(null, 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); return; }