This commit is contained in:
Frédéric FRANCE
2020-10-30 22:09:15 +01:00
committed by GitHub
parent aafac6f989
commit 460af58134

View File

@@ -474,15 +474,13 @@ class Documents extends DolibarrApi
}
$upload_dir = $conf->categorie->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'category').$object->id."/photos/".dol_sanitizeFileName($object->ref);
}
else
{
} else {
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
}
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
if (empty($filearray)) {
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->Ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
}
return $filearray;