Adibag attempts to use ItemRack:RegisterExternalEventListener before Itemrack has initialized
MatthewBerkvens opened this issue ยท 7 comments
Latest versions of both addons on 11/03 (will edit version numbers later)
https://i.imgur.com/wRXUtXr.png
https://i.imgur.com/9EwtkDN.png
I don't know who is responsible for fixing this, created an issue on both repos
AdiAddons/AdiBags#558
@wardz could you have a look please?
Seems like the variable needs to be initialized earlier. You can just move
ItemRack/ItemRack/ItemRack.lua
Lines 147 to 148 in a73c04e
ItemRack.InitEventHandlers
function.@wardz Thanks for having a look at this
@MatthewBerkvens test this please: https://github.com/Rottenbeer/ItemRack/tree/fix-adibags-race
I posted in the AdiBags-ItemRackSets issues already, but I'll put this here in case it helps anyone:
Seems that ItemRack:RegisterExternalEventListener gets loaded later so ItemRack needs to finish loading before it can be used.
Not sure if this is the ideal fix, but I was able to get mine working again by changing a little bit in the Adibags-ItemRackSets.lua file -
On line 35/36 I changed:
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)
to this:
local IREvents = CreateFrame("Frame", nil)
IREvents:RegisterEvent("ADDON_LOADED")
IREvents:SetScript("OnEvent", function(self, event, addon)
if (addon == "ItemRack") then
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)
end
end)
@wardz Thanks for having a look at this
@MatthewBerkvens test this please: https://github.com/Rottenbeer/ItemRack/tree/fix-adibags-race
Works, although the solution posted above seems preferable.
@MatthewBerkvens yeah maybe, but the solution above needs to be taken by the AdiBags dev.