
LUA error
tnwn opened this issue ยท 5 comments
4x ...aceBlizzard_FrameXMLUtil/CollectionsUtil.lua:482: bad argument #1 to 'ipairs' (table expected, got number)
[C]: in function 'ipairs'
[Blizzard_FrameXMLUtil/CollectionsUtil.lua]:482: in function 'AreAllSourcesDisplayableOnPlayer'
[Blizzard_FrameXMLUtil/CollectionsUtil.lua]:493: in function 'GetAppearanceVisibilityWarning'
[Blizzard_FrameXMLUtil/CollectionsUtil.lua]:501: in function 'GetBestVisibilityWarning'
[BetterWardrobe/Modules/Wardrobe.lua]:3417: in function 'RefreshAppearanceTooltip'
[BetterWardrobe/Modules/Wardrobe.lua]:3407: in function 'SetAppearanceTooltip'
[BetterWardrobe/Modules/Wardrobe.lua]:3824: in function <BetterWardrobe/Modules/Wardrobe.lua:3798>
Locals:
(*temporary) = 81753
(*temporary) = "table expected, got number"
Problem seems to be the function CollectionWardrobeUtil.GetBestVisibilityWarning(model, transmogLocation, sources)
(and its sub-function) in "Blizzard_FrameXMLUtil/CollectionsUtil.lua". Blizzard changed it with 11.11.0 to expect a table of sources instead of a sourceID.
The function is called on both BetterWardrobeItemsCollectionMixin:RefreshAppearanceTooltip()
(around line 3400) and BetterWardrobeSetsCollectionMixin:RefreshAppearanceTooltip()
(around line 6100) in "BetterWardrobe\Modules\Wardrobe.lua". Could be fixed by converting the single ID into a table but i am not a LUA expert (might be to quick and dirty). Just a heads up.
Problem seems to be the function
CollectionWardrobeUtil.GetBestVisibilityWarning(model, transmogLocation, sources)
(and its sub-function) in "Blizzard_FrameXMLUtil/CollectionsUtil.lua". Blizzard changed it with 11.11.0 to expect a table of sources instead of a sourceID. The function is called on bothBetterWardrobeItemsCollectionMixin:RefreshAppearanceTooltip()
(around line 3400) andBetterWardrobeSetsCollectionMixin:RefreshAppearanceTooltip()
(around line 6100) in "BetterWardrobe\Modules\Wardrobe.lua". Could be fixed by converting the single ID into a table but i am not a LUA expert (might be to quick and dirty). Just a heads up.
Yeah, the issue seems to be fixed by passing sources
as the third parameter of CollectionWardrobeUtil.GetBestVisibilityWarning
whenever it's called.
The function is called at lines 3417, 6130 and 6148. By changing the lines as below, it appears no more errors are thrown and tooltips work normally.
3417:
local warningString = CollectionWardrobeUtil.GetBestVisibilityWarning(self.tooltipModel, self.transmogLocation, sources);
6130:
local warningString = CollectionWardrobeUtil.GetBestVisibilityWarning(self.Model, self.transmogLocation, sources);
6148:
local warningString = CollectionWardrobeUtil.GetBestVisibilityWarning(self.tooltipModel, self.transmogLocation, sources);