Fix: Tooltip error in other addons that hook itemlink for tooltip

This commit is contained in:
KameleonUK
2026-06-04 06:45:29 +01:00
parent f1618b71bd
commit b2e3485531
2 changed files with 17 additions and 10 deletions
+10 -2
View File
@@ -2524,10 +2524,18 @@ function Guda_ItemButton_OnEnter(self)
GameTooltip:SetHyperlink(self.itemData.link)
end
elseif self.bagID == -2 then
-- Keyring: SetBagItem might be unreliable for -2 in some 1.12.1 environments, fallback to hyperlink if needed
-- Keyring (bag -2): in 1.12 the native SetBagItem builds the keyring tooltip
-- by internally calling SetHyperlink with the FULL colored link
-- (|cff..|Hitem:..|h[Name]|h|r). When other addons (AtlasLoot, WoWTranslate)
-- have re-hooked SetHyperlink in an order that bypasses Guda's stripping, that
-- full link reaches a hook whose captured original is the raw Blizzard
-- SetHyperlink — which only accepts the BARE "item:ID:0:0:0" form and otherwise
-- throws "unknown link type". We avoid that internal path entirely by calling
-- SetHyperlink ourselves with the bare form extracted from the container link.
local link = GetContainerItemLink(self.bagID, self.slotID)
if link then
GameTooltip:SetHyperlink(link)
local _, _, bare = string.find(link, "|H(item:[^|]+)|h")
GameTooltip:SetHyperlink(bare or link)
else
GameTooltip:SetBagItem(self.bagID, self.slotID)
end