platform
platform copied to clipboard
AbstractMapper does not pass 0 values throughout if statement
Summary
We want to set a index on an integer property of our class. The value can be any integer - 0, 1, 2 .. whatever. But then reindex command is executed, AbstractMapper function setDataValue
is called and value is not going into 172 line if($value)
, because it is false
then if(0)
. It should be if(null !== $value)
Steps to reproduce
- Set an index on any integer property there value can be 0.
- Run reindex command
- Value is not inserted into
oro_search_index_integer
DB table.
Actual Result
Value is not inserted into oro_search_index_integer
DB table.
Expected Result
Value should be insrted into oro_search_index_integer
DB table.
Actual code line - https://github.com/oroinc/platform/blob/3360ced4494c60dce997aa7e8fd8798dd74811b8/src/Oro/Bundle/SearchBundle/Engine/AbstractMapper.php#L115
Thank you for the detailed report, @SSMellow! Internal ticket id #BAP-20091.