PR applied on top of #3296977
Pushed local copy of changes here for reference purposes. But !12 seems like the better approach.
Closes #3251227