oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

AbstractMapper does not pass 0 values throughout if statement #1034

Open andriusvo opened 4 years ago

andriusvo commented 4 years ago

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

  1. Set an index on any integer property there value can be 0.
  2. Run reindex command
  3. 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

anyt commented 4 years ago

Thank you for the detailed report, @SSMellow! Internal ticket id #BAP-20091.