diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 0f28a8d1cde..044f3e68c0f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -761,11 +761,9 @@ class Categorie extends CommonObject dol_syslog(get_class($this).'::del_type', LOG_DEBUG); if ($this->db->query($sql)) { - // Save object we want to unlink category off into category instance to provide information to trigger - $this->unlinkoff=$obj; - // Call trigger - $result=$this->call_trigger('CATEGORY_UNLINK',$user); + $this->context=array('unlinkoff'=>$obj); // Save object we want to link category to into category instance to provide information to trigger + $result=$this->call_trigger('CATEGORY_UNLINK',$user); if ($result < 0) { $error++; } // End call triggers diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 44a6645a6d7..c5f704fdcb1 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -75,10 +75,10 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // We remove subscription if we change category (lessw category may means less mailing-list to subscribe) - if (is_object($object->unlinkoff) && method_exists($object->unlinkoff, 'del_to_abo') && $object->unlinkoff->del_to_abo() < 0) + if (is_object($object->context['unlinkoff']) && method_exists($object->context['unlinkoff'], 'del_to_abo') && $object->context['unlinkoff']->del_to_abo() < 0) { - $this->error=$object->unlinkoff->error; - $this->errors=$object->unlinkoff->errors; + $this->error=$object->context['unlinkoff']->error; + $this->errors=$object->context['unlinkoff']->errors; $return=-1; } else