AdiAddons / AdiBags

WoW Addon — Adirelle's bag addon.
https://wowace.com/projects/adibags
GNU General Public License v3.0
157 stars 112 forks source link

Lua Error on classic Era #947

Closed Dragotex closed 11 months ago

Dragotex commented 1 year ago

Addon Version

v1.10.7

World of Warcraft Version

Classic

Describe the bug

When i load the latest Outfitter Addon from git i got this lua error:

Message: Interface\AddOns\AdiBags\core\Utility.lua:465: attempt to call field 'GetContainerItemQuestInfo' (a nil value) Time: Wed Apr 19 03:33:38 2023 Count: 74 Stack: Interface\AddOns\AdiBags\core\Utility.lua:465: attempt to call field 'GetContainerItemQuestInfo' (a nil value) string "=[C]": in function GetContainerItemQuestInfo' [string "@Interface\AddOns\AdiBags\core\Utility.lua"]:465: in function GetContainerItemQuestInfo' [string "@interface\AddOns\AdiBags\widgets\ItemButton.lua"]:333: in function UpdateIcon' [string "@Interface\AddOns\AdiBags\widgets\ItemButton.lua"]:344: in function Update' [string "@interface\AddOns\AdiBags\widgets\ItemButton.lua"]:319: in function FullUpdate' [string "@Interface\AddOns\AdiBags\widgets\ItemButton.lua"]:276: in function <Interface\AddOns\AdiBags\widgets\ItemButton.lua:264> string "=[C]": in function Show' [string "@interface\AddOns\AdiBags\widgets\ContainerFrame.lua"]:1093: in function PrepareSections' [string "@Interface\AddOns\AdiBags\widgets\ContainerFrame.lua"]:1215: in function FullUpdate' [string "@interface\AddOns\AdiBags\widgets\ContainerFrame.lua"]:643: in function <Interface\AddOns\AdiBags\widgets\ContainerFrame.lua:629>

[string "@interface\AddOns\AdiBags\core\Utility.lua"]:106: in function <Interface\AddOns\AdiBags\core\Utility.lua:98> [string "@interface\AddOns\AdiBags\widgets\LayeredRegion.lua"]:119: in function <Interface\AddOns\AdiBags\widgets\LayeredRegion.lua:108>

Also send this error first to the Contributor of this Outfitter release ( https://github.com/cdmichaelb/Outfitter/issues/140 ) and he answerd this:

That looks to be an issue with AdiBags not fixing the GetContainerItemQuestInfo call to a C_Container.GetContainerItemQuestInfo call. The change I made took out a bunch of C_Container fixes for things Outfitter didn't use.

Steps to reproduce

happens with loaded outfitter in the moment when im open the bag

Verification

SpareSimian commented 1 year ago

That API was added in 3.3.0, so maybe Classic lacks it even when using the C_Container namespace. But it's taking the C_Container path, so maybe Blizzard added C_Container in the latest Classic builds.

Here's the code that's failing:

function addon:GetContainerItemQuestInfo(containerIndex, slotIndex)
    -- This function isn't present on classic-era in any form

    if C_Container then
        local result = C_Container.GetContainerItemQuestInfo(containerIndex, slotIndex)
        return result.isQuestItem, result.questID, result.isActive
    elseif GetContainerItemQuestInfo then
        return GetContainerItemQuestInfo(containerIndex, slotIndex)
    end
end
GovtGeek commented 1 year ago

To temporarily fix AdiBags, try adding this in Utility.lua at line 463:

    _, _, _, toc = GetBuildInfo()
    if toc == 11403 then return nil, nil, nil end