mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Fix multienum filters
This commit is contained in:
parent
94105b8177
commit
e47f84cd5e
1 changed files with 21 additions and 0 deletions
|
@ -49,11 +49,32 @@ class MultiEnumFilterMapper implements FilterMapperInterface
|
|||
return [];
|
||||
}
|
||||
|
||||
$filterValues = $values;
|
||||
|
||||
$mapEmptyString = false;
|
||||
foreach ($filterValues as $legacyValueKey => $legacyValueValue) {
|
||||
|
||||
switch ($legacyValueValue) {
|
||||
case "__SuiteCRMEmptyString__":
|
||||
$mapEmptyString = true;
|
||||
$filterValues[$legacyValueKey] = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($mapEmptyString) {
|
||||
return $filterValues;
|
||||
}
|
||||
|
||||
return $criteriaItem['values'];
|
||||
}
|
||||
|
||||
public function toApi(string $mappedValue, array $criteriaItem): string
|
||||
{
|
||||
if ($mappedValue === '') {
|
||||
$mappedValue = "__SuiteCRMEmptyString__";
|
||||
}
|
||||
|
||||
return $mappedValue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue