That does fix it, thank you.
It is worth noting that copying the code like you have would mean that you would have to re license, at least that file, as LGPL. (because k2 is lgpl, and lgpl is kinda strict)
you could instead do something more like:
if mods["Krastorio2"] then
require("__Krastorio2__.prototypes.final-fixes.steel-pipe-connectivity")
at least I think. my fix just requires both and has a final-fixes file that is just that requires line lol
to tell it to rerun that function from the other code, rather than copying it to avoid licensing stuff.
It probably doesn't matter. I don't think anybody really cares. Its just something I learned when I made my temp fix mod to publish that I thought I'd share.