TransmogRoulette

TransmogRoulette

395k Downloads

OnLoad error when opening collections journal

kemayo opened this issue ยท 2 comments

commented

When I first open the collections UI in a session, I get this error:

12x [string "*:OnLoad"]:4: bad argument #1 to 'pairs' (table expected, got nil)
[string "=[C]"]: in function `pairs'
[string "*:OnLoad"]:4: in function <[string "*:OnLoad"]:1>
[string "=[C]"]: in function `LoadAddOn'
[string "@FrameXML\UIParent.lua"]:508: in function `UIParentLoadAddOn'
[string "@FrameXML\UIParent.lua"]:674: in function `CollectionsJournal_LoadUI'
[string "@FrameXML\UIParent.lua"]:1107: in function `SetCollectionsJournalShown'
[string "@FrameXML\UIParent.lua"]:1101: in function `ToggleCollectionsJournal'
[string "@FrameXML\MainMenuBarMicroButtons.lua"]:1053: in function <FrameXML\MainMenuBarMicroButtons.lua:1051>
[string "=[C]"]: ?

Locals:
(*temporary) = nil
(*temporary) = "table expected, got nil"
 = <function> defined =[C]:-1

This seems to boil down to TransmogRoulette.xml line 184: for _, button in pairs(WardrobeTransmogFrame.ModelScene.SlotButtons) do, as 9.1. has made WardrobeTransmogFrame.ModelScene.SlotButtons now be nil... I assume as part of the changes to support the new shoulder separate-transmog option.

commented

Here's a fix. Edit TransmogRoulette.xml

Line 184. Replace
for _, button in pairs(WardrobeTransmogFrame.ModelScene.SlotButtons) do
with
for _, button in pairs(WardrobeTransmogFrame.SlotButtons) do

Lines 217-218 Replace
local transmogLocation = TransmogUtil.GetTransmogLocation(slotID, Enum.TransmogType.Appearance, Enum.TransmogModification.None);
C_Transmog.SetPending(transmogLocation, sourceID, categoryID)

with

local transmogLocation = TransmogUtil.GetTransmogLocation(slotID, Enum.TransmogType.Appearance, Enum.TransmogModification.Main);
pendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Apply, sourceID);
C_Transmog.SetPending(transmogLocation, pendingInfo)

That should do it!

commented

Looks like that was committed in 181615d.