Issue #24005:move execution of patch to before setting of version