Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
This commit is contained in:
parent
dfa13ea255
commit
534db40d87
@ -3789,7 +3789,7 @@ abstract class CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Add objects linked in llx_element_element.
|
||||
* Add an object link into llx_element_element.
|
||||
*
|
||||
* @param string $origin Linked element type
|
||||
* @param int $origin_id Linked element id
|
||||
@ -4111,6 +4111,21 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the cache saying that all linked object were already loaded. So next fetchObjectLinked will reload all links.
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @see fetchObjectLinked()
|
||||
*/
|
||||
public function clearObjectLinkedCache()
|
||||
{
|
||||
if ($this->id > 0 && !empty($this->linkedObjectsFullLoaded[$this->id])) {
|
||||
unset($this->linkedObjectsFullLoaded[$this->id]);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update object linked of a current object
|
||||
*
|
||||
|
||||
@ -90,6 +90,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
$this->error = $newobject->error;
|
||||
$this->errors[] = $newobject->error;
|
||||
}
|
||||
|
||||
$object->clearObjectLinkedCache();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
@ -111,6 +114,9 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
$this->error = $newobject->error;
|
||||
$this->errors[] = $newobject->error;
|
||||
}
|
||||
|
||||
$object->clearObjectLinkedCache();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user