Merge pull request #17546 from kastoras/fix_get_documents_response_problem

Fix #17545 /get /documents response data problem
This commit is contained in:
Laurent Destailleur 2021-05-11 18:53:02 +02:00 committed by GitHub
commit fe4227d04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -529,9 +529,13 @@ class EcmFiles extends CommonObject
$sqlwhere = array(); $sqlwhere = array();
if (count($filter) > 0) { if (count($filter) > 0) {
foreach ($filter as $key => $value) { foreach ($filter as $key => $value) {
if ($key == 't.src_object_id') {
$sqlwhere[] = $key.' = '.((int) $value);
} else {
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
} }
} }
}
$sql .= ' WHERE 1 = 1'; $sql .= ' WHERE 1 = 1';
/* Fetching this table depends on filepath+filename, it must not depends on entity /* Fetching this table depends on filepath+filename, it must not depends on entity
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {