2
0
forked from Wavyzz/dolibarr

Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer
2021-10-25 20:07:31 +00:00
parent f64cd9d859
commit 5567310e44
72 changed files with 307 additions and 291 deletions

View File

@@ -497,11 +497,11 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
} else {
if (($object->id) > 0 && !empty($modulepart)) {
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($this->db);
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
if ($result < 0) {
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
$filearray['ecmfiles_infos'] = $ecmfile->lines;
}