What does the provided patch do?
I fixed the spellCache instead of just skipping it like the previous MoP fix did. This is important because some types of abilities, like the mage Teleport flyout, don't restore correctly off spellid. They need the spellCache.
The problem was that the grayed out "offspec" tabs were getting scanned, and since they're scanned later they overwrite the earlier data. And spells in those gray tabs can't be picked up. GetSpellTabInfo() now has a 6th return for "offSpecID". This is 0 normally, and non-zero on the grayed-out tabs. So when it's non-zero, I skip the tab and don't put it in the cache.