From 7ffc46e1da538cac9b848c4702f645842e7cafce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Jul 2019 09:47:05 +0200 Subject: [PATCH] FIX When we are in update mode, so we use $this->entity --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index db32cc787e5..6e52660206f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Christophe Combelles - * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2005-2019 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Cédric Salvador @@ -111,7 +111,7 @@ function setEntity($currentobject) } else { - return $conf->entity; + return ((is_object($currentobject) && $currentobject->id > 0 && $currentobject->entity > 0) ? $currentobject->entity : $conf->entity); } }