Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2023-09-21 12:38:41 +02:00
49 changed files with 117 additions and 110 deletions

View File

@@ -2090,7 +2090,8 @@ abstract class CommonObject
/**
* Load properties id_previous and id_next by comparing $fieldid with $this->ref
*
* @param string $filter Optional filter. Example: " AND (t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here.
* @param string $filter Optional SQL filter. Example: "(t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here.
* Use SQL and not Universal Search Filter. @TODO Replace this with an USF string after changing all ->next_prev_filter
* @param string $fieldid Name of field to use for the select MAX and MIN
* @param int $nodbprefix Do not include DB prefix to forge table name
* @return int <0 if KO, >0 if OK
@@ -2155,7 +2156,7 @@ abstract class CommonObject
}
if (!empty($filter)) {
if (!preg_match('/^\s*AND/i', $filter)) {
$sql .= " AND "; // For backward compatibility
$sql .= " AND ";
}
$sql .= $filter;
}