Fix for tracker #31256

Replaces GitHub PR #1364