Fix inconsistant link element (#30258)
This commit is contained in:
parent
5660bf5b4f
commit
ac136ec1ae
1 changed files with 11 additions and 0 deletions
|
|
@ -8203,6 +8203,17 @@ abstract class CommonObject
|
|||
|
||||
if (!empty($classpath)) {
|
||||
dol_include_once($InfoFieldList[1]);
|
||||
|
||||
if ($classname && !class_exists($classname)) {
|
||||
// from V19 of Dolibarr, In some cases link use element instead of class, example project_task
|
||||
// TODO use newObjectByElement() introduce in V20 by PR #30036 for better errors management
|
||||
$element_prop = getElementProperties($classname);
|
||||
if ($element_prop) {
|
||||
$classname = $element_prop['classname'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($classname && class_exists($classname)) {
|
||||
$object = new $classname($this->db);
|
||||
if ($object->element === 'product') { // Special case for product because default valut of fetch are wrong
|
||||
|
|
|
|||
Loading…
Reference in a new issue