ExtraFields::showInputField normalises the legacy "(field=123)" filter syntax of "List from a table" extrafields into the modern USF "(field:=:123)" form. The compatibility regex "/^\(?([a-z0-9]+)([=<>]+)(\d+)\)?$/i" only accepts alphanumeric field names, so a filter like "fk_typent=2" does not match, the filter is left as is, and forgeSQLFromUniversalSearchCriteria later fails with "Filter error" because the raw expression is not valid universal search syntax. Accept the underscore character in the field name class, the rest of the predicate is untouched. The two identical occurrences in the file (one per branch of the dispatch) are updated. Reported and root cause pinpointed by @stephanebourdon-cmyk. Signed-off-by: Dolicraft <contact@dolicraft.com> Co-authored-by: Dolicraft <contact@dolicraft.com>
This commit is contained in:
parent
d17ae69331
commit
8d8debd441
1 changed files with 2 additions and 2 deletions
|
|
@ -1408,7 +1408,7 @@ class ExtraFields
|
|||
|
||||
// Fix better compatibility with some old extrafield syntax filter "(field=123)"
|
||||
$reg = array();
|
||||
if (preg_match('/^\(?([a-z0-9]+)([=<>]+)(\d+)\)?$/i', $InfoFieldList[4], $reg)) {
|
||||
if (preg_match('/^\(?([a-z0-9_]+)([=<>]+)(\d+)\)?$/i', $InfoFieldList[4], $reg)) {
|
||||
$InfoFieldList[4] = '('.$reg[1].':'.$reg[2].':'.$reg[3].')';
|
||||
}
|
||||
|
||||
|
|
@ -1638,7 +1638,7 @@ class ExtraFields
|
|||
|
||||
// Fix better compatibility with some old extrafield syntax filter "(field=123)"
|
||||
$reg = array();
|
||||
if (preg_match('/^\(?([a-z0-9]+)([=<>]+)(\d+)\)?$/i', $InfoFieldList[4], $reg)) {
|
||||
if (preg_match('/^\(?([a-z0-9_]+)([=<>]+)(\d+)\)?$/i', $InfoFieldList[4], $reg)) {
|
||||
$InfoFieldList[4] = '('.$reg[1].':'.$reg[2].':'.$reg[3].')';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue