[SP-811] - Backport of [PDI-10554] to 4.8

the backport commit contains fix and unit test