Code:
EsoUI/Ingame/Inventory/InventorySlot.lua:903: attempt to access a private function 'PickupInventoryItem' from insecure code
stack traceback:
EsoUI/Ingame/Inventory/InventorySlot.lua:903: in function 'InitiateDestroyItem'
EsoUI/Ingame/Inventory/InventorySlot.lua:1453: in function 'OnSelect'
EsoUI/Libraries/ZO_ContextMenus/ZO_ContextMenus.lua:412: in function 'ZO_Menu_ClickItem'
8371350907706105899:4: in function '(main chunk)'
Report here:
Error deleting items every few hours.
=(
Looking for addon causing a bug
Any addon showing a context-menu can causes it. But there is nothing wrong with the calling:
ClearMenu() AddMenuItem ... ShowMenu(), right?
How to reproduce:
Do in chat window:
1. /reloadui
2. /script ClearMenu() AddMenuItem("") ShowMenu() ClearMenu()
3. Go and use an item of your inventory using context-menu
unsecure code?!?
Try this:
1. /reloadui
2. go and open journal and right-click a quest to open a context-menu. In fact any build-in context-menu would be ok. You could also open the context-menu of the inventory.
3. /script ClearMenu() AddMenuItem("") ShowMenu() ClearMenu()
4. Go and use an item of your inventory using context-menu
now the same code is secure.
The critical call is AddMenuItem("")
Here is another example:
"secure" code adding a normal button below the context-menu
Lua Code:
local good = WINDOW_MANAGER:CreateControlFromVirtual("GoodBoy", ZO_Menu, "ZO_DefaultButton")
good:SetDimensions(320, 32)
good:SetAnchor(TOPLEFT, nil, BOTTOMLEFT)
good:SetText("Click me")
"unsecure" code adding a ZO_MenuItem control.
Lua Code:
local bad = WINDOW_MANAGER:CreateControlFromVirtual("BadBoy", ZO_Menu, "ZO_MenuItem")
bad:GetNamedChild("Name"):SetText("Click me")
bad:SetAnchor(TOPLEFT, nil, BOTTOMLEFT)
bad:SetHidden(false)
It depends on who uses the template ZO_MenuItem first?!?
Seems to be a game-in bug. Or AddMenuItem should not be public. What else should be used?