Merge MR 1790 to 8-2 stable
This cherry-picks my changes from !1790 (merged) into the 8-2 stable branch so they can eventually also be merged into EE.
This cherry-picks my changes from !1790 (merged) into the 8-2 stable branch so they can eventually also be merged into EE.