AdiBags

AdiBags

8M Downloads

Lua Error on classic Era

Dragotex opened this issue ยท 2 comments

commented

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 "=[C]"]: ?
[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 ( cdmichaelb/Outfitter#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

  • I have disabled all other addons and made sure this bug is triggered only with AdiBags enabled
commented

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
commented

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

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