typicalzergling / vendor

Vendor WoW Addon
MIT License
4 stars 4 forks source link

on tooltip lua error #80

Open xenoterracide opened 3 months ago

xenoterracide commented 3 months ago

classic Season of Discovery vendor 6.6.0

Message: ...Ons/Vendor/systems/itemproperties/itemproperties.lua:184: attempt to call method 'IsItemAccountBoundInTooltip' (a nil value)
Time: Sat Jul 20 14:55:52 2024
Count: 7
Stack: ...Ons/Vendor/systems/itemproperties/itemproperties.lua:184: attempt to call method 'IsItemAccountBoundInTooltip' (a nil value)
[string "@Interface/AddOns/Vendor/systems/itemproperties/itemproperties.lua"]:184: in function <...Ons/Vendor/systems/itemproperties/itemproperties.lua:72>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/Vendor/systems/evaluation/itemresultcache.lua"]:112: in function <...AddOns/Vendor/systems/evaluation/itemresultcache.lua:99>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "@Interface/AddOns/Vendor/features/tooltip/tooltip_classic.lua"]:175: in function `AddItemTooltipLines'
[string "@Interface/AddOns/Vendor/features/tooltip/tooltip_classic.lua"]:126: in function <...e/AddOns/Vendor/features/tooltip/tooltip_classic.lua:123>
[string "=[C]"]: in function `xpcall'
[string "@Interface/AddOns/Vendor/features/tooltip/tooltip_classic.lua"]:122: in function <...e/AddOns/Vendor/features/tooltip/tooltip_classic.lua:120>
[string "@Interface/AddOns/Vendor/sys/hook.lua"]:52: in function <Interface/AddOns/Vendor/sys/hook.lua:50>
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@Interface/AddOns/Vendor/sys/hook.lua"]:95: in function `SetBagItem'
[string "@Interface/AddOns/Blizzard_UIPanels_Game/Classic/ContainerFrame_Shared.lua"]:1428: in function `ContainerFrameItemButton_OnEnter'
[string "@Interface/AddOns/BetterBags/frames/era/item.lua"]:247: in function `UpdateTooltip'
[string "@Interface/AddOns/BetterBags/frames/era/item.lua"]:313: in function <Interface/AddOns/BetterBags/frames/era/item.lua:313>

Locals: itemObj = <table> {
 GetItemLocation = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:66
 SetItemLink = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:56
 HasItemLocation = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:70
 LockItem = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:113
 itemLocation = <table> {
 }
 GetItemID = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:98
 IsItemDataCached = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:216
 GetInventoryTypeName = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:210
 GetCurrentItemLevel = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:172
 GetItemQualityColor = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:183
 UnlockItem = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:119
 Clear = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:74
 GetItemIcon = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:125
 IsItemLocked = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:109
 GetItemLink = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:146
 SetItemLocation = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:51
 GetItemName = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:135
 IsItemInPlayersControl = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:92
 GetItemQuality = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:161
 GetItemGUID = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:199
 GetInventoryType = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:188
 IsItemEmpty = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:80
 GetStaticBackingItem = <function> defined @Interface/AddOns/Blizzard_ObjectAPI/Classic/Item.lua:88
 SetItemID = <function> defined @Interface/AddOns/Blizzard_Ob
Road-block commented 2 months ago

This and #79 as well as #73 are duplicates (same issue)

The problem lies in splitting the backing methods for itemproperties:IsItemAccountBoundInTooltip to appropriate files but then not moving the higher level method to a file both clients (retail / classic) load (for example: itemproperties.lua itself.

:IsStringInTooltipLeftText overloaded method in separate client specific files: ✔️ :IsItemAccountBoundInTooltip method in retail only loaded file: ❌

Solution: Cut

-- Account Bound -- Now called Warbound
function ItemProperties:IsItemAccountBoundInTooltip(tooltipdata)
    return self:IsStringInTooltipLeftText(tooltipdata, L["TOOLTIP_SCAN_ACCOUNTBOUND"])
end

from itempropertiestooltipscan.lua (retail only) file and move it to itemproperties.lua base file. Alternatively duplicate it to itempropertiestooltipscan_classic.lua (classic) file.

I don't know if there's more cases like this. This was the immediate error I got on Cataclysm Classic trying to use v6.6.0

Road-block commented 2 months ago

Fixing the above error leads to this (again for Cataclysm Classic)

10x ...s/itemproperties/itempropertytooltipscan_classic.lua:66: Invalid arguments to Tooltip Scanner
[string "=[C]"]: in function `error'
[string "@Vendor/systems/itemproperties/itempropertytooltipscan_classic.lua"]:66: in function <...s/itemproperties/itempropertytooltipscan_classic.lua:50>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "@Vendor/systems/itemproperties/itemproperties.lua"]:184: in function <...Ons/Vendor/systems/itemproperties/itemproperties.lua:72>
[string "=(tail call)"]: ?
[string "@Vendor/systems/evaluation/itemresultcache.lua"]:112: in function <Vendor/systems/evaluation/itemresultcache.lua:99>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "=[C]"]: in function `xpcall'
[string "@Vendor/features/merchant/merchant.lua"]:160: in function <Vendor/features/merchant/merchant.lua:119>

Locals:
(*temporary) = "Invalid arguments to Tooltip Scanner"

Addon now tries to use the proper tooltip scanner but it then errors itself.

I think addon needs a proper test on Cataclysm Classic (maybe other non-retail versions too) 😊