TransmogTokens
TransmogTokens copied to clipboard
TransmogTokens-1.4.9.lua:509: attempt to call method 'GetSlotTransmogSources' (a nil value)
Unsure if this addon is still in development since it hasn't been updated since 8.0, but I'm posting this just in case.
Ran into an error today while I was going through my reagents bank. Upon mousing over a stack of Sunmotes I have for crafting TBC gear for transmog I received the following error. Thanks.
26x TransmogTokens\TransmogTokens-1.4.9.lua:509: attempt to call method 'GetSlotTransmogSources' (a nil value)
[string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:509: in function getSource' [string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:518: in function
getAppearanceID'
[string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:562: in function calculateNeededSingle' [string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:549: in function
calculateNeeded'
[string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:574: in function calculateNeededText' [string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:621: in function
processTooltip'
[string "@TransmogTokens\TransmogTokens-1.4.9.lua"]:687: in function <TransmogTokens\TransmogTokens.lua:684>
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@BetterWardrobe\Libs\AceHook-3.0\AceHook-3.0-9.lua"]:95: in function <...dOns\BetterWardrobe\Libs\AceHook-3.0\AceHook-3.0.lua:87>
...
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@TradeSkillMaster\LibTSM\Service\ItemTooltipClasses\Wrapper.lua"]:107: in function <...Master\LibTSM\Service\ItemTooltipClasses\Wrapper.lua:105>
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@Vendor\sys\hook.lua"]:95: in function <Vendor\sys\hook.lua:91>
[string "=[C]"]: in function `SetInventoryItem'
[string "@FrameXML\BankFrame.lua"]:49: in function <FrameXML\BankFrame.lua:46>
Locals: itemLink = "|cffa335ee|Hitem:34388::::::::60:251:::1:::::::|h[Pauldrons of Berserking]|h|r" itemID = 34388 _ = "Armor" _ = "Plate" slotName = "INVTYPE_SHOULDER" slots =
Might have a fix for this, but be warned that i have no idea if this actually fixes the problem or just takes away the error itself, breaks something else or will be broken in the future. Note that i also don't know LUA all that well, so it might not be the best way of writing this code.
To fix replace the code block from line 492 to 515 in TransmogTokens.lua with this code:
TransmogTokens.getSource = function(itemLink)
if itemLink == nil then
return;
end
local itemID, _, _, slotName = GetItemInfoInstant(itemLink);
if t.INVENTORY_SLOTS == nil then
local slots = slotName
else
local slots = t.INVENTORY_SLOTS[slotName];
end
if not slots or not IsDressableItem(itemLink) then
return;
end
model:SetUnit("player");
model:Undress();
if type(slots) == "table" then
for i, slot in pairs(slots) do
model:TryOn(itemLink, slot);
local source = model:GetSlotTransmogSources(slot);
if source ~= 0 then
return source;
end
end
else
model:TryOn(itemLink, Slots);
local source = model:GetSlotTransmogSources(slots);
if source ~= 0 then
return source;
end
end
end
https://github.com/Stanzilla/WoWUIBugs/wiki/9.1.0-Consolidated-UI-Changes
Removed: DressUpModel:GetSlotTransmogSources
Updated fix. Replace the function TransmogTokens.getSource with the below:
TransmogTokens.getSource = function(itemLink)
if itemLink == nil then
return;
end
local source = select(2, C_TransmogCollection.GetItemInfo(itemLink))
if source then
return source
end
local itemID, _, _, slotName = GetItemInfoInstant(itemLink);
local slots = t.INVENTORY_SLOTS[slotName];
if not slots or not IsDressableItem(itemLink) then
return;
end
model:SetUnit("player");
model:Undress();
for i, slot in pairs(slots) do
model:TryOn(itemLink, slot);
local info = model:GetItemTransmogInfo(slot);
if info and info.appearanceID ~= nil and info.appearanceID ~= 0 then
return info.appearanceID;
end
end
end