AdiBags

AdiBags

8M Downloads

Adibag attempts to use ItemRack:RegisterExternalEventListener before Itemrack has initialized

MatthewBerkvens opened this issue ยท 3 comments

commented

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
Rottenbeer/ItemRack#148

commented

Is it possible that the order of loading might change in the future? If so, you might add code to handle the case where IR is already loaded.

commented

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)
commented

AdiBags-ItemRackSets is a third-party addon, so this issue definitely belongs there. However, ItemRack's addon author has already implemented a workaround.