Issue #1811850 forward-port to 7.x-2.x.