From d2ef60bee2d8c92e1fabd70844b63153034318f8 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Fri, 26 Jun 2026 07:02:09 +0000 Subject: [PATCH 1/2] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/pull/2280 --- spec/System/TestItemMods_spec.lua.rej | 22 ++++++++++++++++++++++ src/Classes/ItemsTab.lua.rej | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 spec/System/TestItemMods_spec.lua.rej create mode 100644 src/Classes/ItemsTab.lua.rej diff --git a/spec/System/TestItemMods_spec.lua.rej b/spec/System/TestItemMods_spec.lua.rej new file mode 100644 index 00000000000..cd8fda8206c --- /dev/null +++ b/spec/System/TestItemMods_spec.lua.rej @@ -0,0 +1,22 @@ +diff a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua (rejected hunks) +@@ -33,6 +33,20 @@ describe("TetsItemMods", function() + assert.are.equals(2, legacyLines) + end) + ++ it("shows a fallback tooltip when an item's base is no longer supported", function() ++ local item = new("Item", [[ ++ Rarity: Unique ++ Legacy Item ++ Removed Base ++ ]]) ++ local tooltip = new("Tooltip") ++ ++ assert.has_no.errors(function() ++ build.itemsTab:AddItemTooltip(tooltip, item) ++ end) ++ assert.is_truthy(tooltip.lines[#tooltip.lines].text:find("Item base is not supported", 1, true)) ++ end) ++ + it("aggregates matching ring item rarity lines before applying ring bonus effect", function() + build.configTab.input.customMods = "30% increased bonuses gained from left Equipped Ring" + build.configTab:BuildModList() diff --git a/src/Classes/ItemsTab.lua.rej b/src/Classes/ItemsTab.lua.rej new file mode 100644 index 00000000000..7faf71ea8f8 --- /dev/null +++ b/src/Classes/ItemsTab.lua.rej @@ -0,0 +1,15 @@ +diff a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua (rejected hunks) +@@ -3232,6 +3232,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth) + tooltip.tooltipHeader = item.rarity + tooltip.center = true + tooltip.color = rarityCode ++ -- Shared items can use old base names that no longer exist. Add a tooltip so they can be copied or removed without causing a crash. ++ if not item.base or not item.baseName then ++ tooltip:AddLine(fontSizeTitle, rarityCode..(item.title or item.name or "Unknown Item"), "FONTIN SC") ++ tooltip:AddSeparator(30) ++ tooltip:AddLine(fontSizeTitle, colorCodes.NEGATIVE.."Item base is not supported by the current version.", "FONTIN SC") ++ return ++ end + -- Item name + if item.title then + tooltip:AddLine(fontSizeTitle, rarityCode..item.title, "FONTIN SC") From 2ceb815dd355deb2aed09b7a91abdd117a637b71 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Tue, 21 Jul 2026 13:21:52 +1000 Subject: [PATCH 2/2] Fix merge --- spec/System/TestItemMods_spec.lua | 15 +++++++++++++++ spec/System/TestItemMods_spec.lua.rej | 22 ---------------------- src/Classes/ItemsTab.lua | 7 +++++++ src/Classes/ItemsTab.lua.rej | 15 --------------- 4 files changed, 22 insertions(+), 37 deletions(-) delete mode 100644 spec/System/TestItemMods_spec.lua.rej delete mode 100644 src/Classes/ItemsTab.lua.rej diff --git a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua index 3c185d98ace..8606a2a5fa7 100644 --- a/spec/System/TestItemMods_spec.lua +++ b/spec/System/TestItemMods_spec.lua @@ -612,4 +612,19 @@ describe("TetsItemMods", function() assert.are.equals(baseFrenzyChargesMax + 1, build.calcsTab.calcsOutput.FrenzyChargesMax) assert.are.equals(baseEnduranceChargesMax + 1, build.calcsTab.calcsOutput.EnduranceChargesMax) end) + + it("shows a fallback tooltip when an item's base is no longer supported", function() + local item = new("Item", [[ + Rarity: Unique + Legacy Item + Removed Base + ]]) + local tooltip = new("Tooltip") + + assert.has_no.errors(function() + build.itemsTab:AddItemTooltip(tooltip, item) + end) + assert.is_truthy(tooltip.lines[#tooltip.lines].text:find("Item base is not supported", 1, true)) + end) + end) diff --git a/spec/System/TestItemMods_spec.lua.rej b/spec/System/TestItemMods_spec.lua.rej deleted file mode 100644 index cd8fda8206c..00000000000 --- a/spec/System/TestItemMods_spec.lua.rej +++ /dev/null @@ -1,22 +0,0 @@ -diff a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua (rejected hunks) -@@ -33,6 +33,20 @@ describe("TetsItemMods", function() - assert.are.equals(2, legacyLines) - end) - -+ it("shows a fallback tooltip when an item's base is no longer supported", function() -+ local item = new("Item", [[ -+ Rarity: Unique -+ Legacy Item -+ Removed Base -+ ]]) -+ local tooltip = new("Tooltip") -+ -+ assert.has_no.errors(function() -+ build.itemsTab:AddItemTooltip(tooltip, item) -+ end) -+ assert.is_truthy(tooltip.lines[#tooltip.lines].text:find("Item base is not supported", 1, true)) -+ end) -+ - it("aggregates matching ring item rarity lines before applying ring bonus effect", function() - build.configTab.input.customMods = "30% increased bonuses gained from left Equipped Ring" - build.configTab:BuildModList() diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index e6083ea7839..31169b59023 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -3894,6 +3894,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth) tooltip.foilType = item.foilType tooltip.center = true tooltip.color = rarityCode + -- Shared items can use old base names that no longer exist. Add a tooltip so they can be copied or removed without causing a crash. + if not item.base or not item.baseName then + tooltip:AddLine(fontSizeTitle, rarityCode..(item.title or item.name or "Unknown Item"), "FONTIN SC") + tooltip:AddSeparator(30) + tooltip:AddLine(fontSizeTitle, colorCodes.NEGATIVE.."Item base is not supported by the current version.", "FONTIN SC") + return + end self:SetTooltipHeaderInfluence(tooltip, item) -- Item name if item.title then diff --git a/src/Classes/ItemsTab.lua.rej b/src/Classes/ItemsTab.lua.rej deleted file mode 100644 index 7faf71ea8f8..00000000000 --- a/src/Classes/ItemsTab.lua.rej +++ /dev/null @@ -1,15 +0,0 @@ -diff a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua (rejected hunks) -@@ -3232,6 +3232,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth) - tooltip.tooltipHeader = item.rarity - tooltip.center = true - tooltip.color = rarityCode -+ -- Shared items can use old base names that no longer exist. Add a tooltip so they can be copied or removed without causing a crash. -+ if not item.base or not item.baseName then -+ tooltip:AddLine(fontSizeTitle, rarityCode..(item.title or item.name or "Unknown Item"), "FONTIN SC") -+ tooltip:AddSeparator(30) -+ tooltip:AddLine(fontSizeTitle, colorCodes.NEGATIVE.."Item base is not supported by the current version.", "FONTIN SC") -+ return -+ end - -- Item name - if item.title then - tooltip:AddLine(fontSizeTitle, rarityCode..item.title, "FONTIN SC")