-
Problem report
-
Resolution: Fixed
-
Trivial
-
6.0.14rc2, 6.2.8rc2, 6.4.0rc3
-
Sprint 98 (Mar 2023), Sprint 99 (Apr 2023)
-
0.25
1. Create several value mappings:
type | value | mapped to |
---|---|---|
equals | 1K | A |
equals | 2X | B |
equals | Y3Y | C |
2. Create numeric item (integer or float)
3. Send some values to item and observe the results:
item value | result | expected |
---|---|---|
0 | C (0) | 0 |
1 | A (1) | 1 |
2 | B (2) | 2 |
3 | 3 | 3 |
Possible solution to change this code in CValueMapHelper.php::matchMapping():
(floatval($value) == floatval($mapping['value']))
to check if the mapping is actually numeric:
(is_numeric($mapping['value']) && floatval($value) == floatval($mapping['value']))