From 4c9ccb163c56a1d0f29e8fa92069c2d173c88859 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Mar 2018 17:58:24 +0200 Subject: [PATCH] Remove deprecated way of working. Use context array instead. --- htdocs/categories/class/categorie.class.php | 1 - ...interface_50_modMailmanspip_Mailmanspipsynchro.class.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index bc36a5cbf94..d8d5b10a2b5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -706,7 +706,6 @@ class Categorie extends CommonObject // Call trigger - $this->linkto=$obj; // Deprecated. Save object we want to link category to into category instance to provide information to trigger $this->context=array('linkto'=>$obj); // Save object we want to link category to into category instance to provide information to trigger $result=$this->call_trigger('CATEGORY_LINK',$user); if ($result < 0) { $error++; } diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index a0fbe09405c..ecf57316c89 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -56,10 +56,10 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // We add subscription if we change category (new category may means more mailing-list to subscribe) - if (is_object($object->linkto) && method_exists($object->linkto, 'add_to_abo') && $object->linkto->add_to_abo() < 0) + if (is_object($object->context['linkto']) && method_exists($object->context['linkto'], 'add_to_abo') && $object->context['linkto']->add_to_abo() < 0) { - $this->error=$object->linkto->error; - $this->errors=$object->linkto->errors; + $this->error=$object->context['linkto']->error; + $this->errors=$object->context['linkto']->errors; $return=-1; } else