Closes #3171604
This is copy of MR19 but for branch 2.x. Need it to be able to apply automatic patches by composer.
Will remove MR19 if this one will be merged.
P.S.: MR35 is also a copy of this merge request.