Update commonobject.class.php

This commit is contained in:
Laurent Destailleur 2020-06-02 15:45:40 +02:00 committed by GitHub
parent c655720b78
commit da481049c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7898,11 +7898,13 @@ abstract class CommonObject
$deleteMethod=$deleteFromObject[2];
if (dol_include_once($filePath)) {
$childObject = new $className($this->db);
$result= $childObject->{$deleteMethod}($this->id);
if ($result<0) {
$this->errors[] = $childObject->error;
return -1;
}
if (method_exists($childObject, $deleteMethod)) {
$result= $childObject->{$deleteMethod}($this->id);
if ($result<0) {
$this->errors[] = $childObject->error;
return -1;
}
}
} else {
$this->errors[] = 'Cannot find child class file ' .$filePath;
return -1;