Remove deprecated way of working. Use context array instead.

This commit is contained in:
Laurent Destailleur 2018-03-27 17:58:24 +02:00
parent 0c449b2ff4
commit 4c9ccb163c
2 changed files with 3 additions and 4 deletions

View File

@ -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++; }

View File

@ -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