diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index ddb44153e499471129112e9f2cb8c39164127b0b..b7e79def212a9e313e6a60fde819947d88715769 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -398,6 +398,7 @@ if (empty($reshook)) } // Now we create same links to contact than the ones found on origin object + /* Useless, already into the create if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; @@ -420,7 +421,7 @@ if (empty($reshook)) } } else dol_print_error($resqlcontact); - } + }*/ // Hooks $parameters = array('objFrom' => $srcobject); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f9ebf8a4cde4ae3c7bf93968bca00826b45307c5..235e3a1aa7579c8b314e048c6be5de4162fdb4e4 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -920,7 +920,8 @@ class Commande extends CommonOrder foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + if (is_object($value)) $originidforcontact = $value->id; + else $originidforcontact = $value; break; // We take first one } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7adc13d37240ad1b99421cbab320fd97234098f6..60f711688cc0df1eb8c11e894ee606719f6efede 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1249,6 +1249,7 @@ if (empty($reshook)) } // Now we create same links to contact than the ones found on origin object + /* Useless, already into the create if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; @@ -1271,7 +1272,7 @@ if (empty($reshook)) } } else dol_print_error($resqlcontact); - } + }*/ // Hooks $parameters = array('objFrom' => $srcobject); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b5a399675e7a13bb503c0524cee8cc49105993ba..1f8d17f046843d35f0e6b634b89d44706f19e9c6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -489,7 +489,8 @@ class Facture extends CommonInvoice foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + if (is_object($value)) $originidforcontact = $value->id; + else $originidforcontact = $value; break; // We take first one } }