Issue #2851149 by hchonov, amateescu, Wim Leers: Exceptions on setting entity reference field with integer target ID and entity object