Fixes #24990 (closed) and fixes #25235 (closed) by undoing #22740.
This needs more thought in regards to what replace this with, but for now I want to at least have a fix for the identified problem. Consider this WIP until we have an alternative.
/cc @pat270