From e1d30837e9f6beefbe25ccd72aa3d5326d2c07c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sat, 3 May 2014 03:10:58 +0200 Subject: [PATCH] Try to remove a warning --- htdocs/adherents/index.php | 9 ++++++--- htdocs/core/class/commonobject.class.php | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index af4276bf0cd..8f7ad2bd947 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -237,11 +237,14 @@ if ($resql) $staticmember->id=$obj->rowid; $staticmember->lastname=$obj->lastname; $staticmember->firstname=$obj->firstname; - if (! empty($obj->fk_soc)) { - $staticmember->socid = $obj->fk_soc; + if (! empty($obj->fk_soc)) + { + $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); $staticmember->name=$staticmember->thirdparty->name; - } else { + } + else + { $staticmember->name=$obj->company; } $staticmember->ref=$staticmember->getFullName($langs); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 29bbbebaad9..d40544217c6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -590,7 +590,7 @@ abstract class CommonObject } /** - * Load the third party of object from id $this->socid into this->thirdpary + * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdpary * * @return int <0 if KO, >0 if OK */ @@ -598,10 +598,10 @@ abstract class CommonObject { global $conf; - if (empty($this->socid)) return 0; + if (empty($this->socid) && empty($this->fk_soc)) return 0; $thirdparty = new Societe($this->db); - $result=$thirdparty->fetch($this->socid); + $result=$thirdparty->fetch(isset($this->socid)?$this->socid:$this->fk_soc); $this->client = $thirdparty; // deprecated $this->thirdparty = $thirdparty; -- GitLab