Rarity

Rarity

18M Downloads

The export UI is broken after 11.2 API changes to Blizzard's StaticPopup dialog

Closed this issue · 4 comments

commented

Hello,

I have create an item to export it:

Image

And when i want export it, i have this errors:

Show verbose Lua error details
1x Rarity_Options/Options.lua:211: attempt to index field 'editBox' (a nil value)
[Rarity_Options/Options.lua]:211: in function 'OnHide'
[Blizzard_StaticPopup/StaticPopup.lua]:586: in function <Blizzard_StaticPopup/StaticPopup.lua:572>
[C]: in function 'StaticPopup_OnHide'
[Blizzard_StaticPopup_Game/GameDialog.lua]:677: in function <...faceBlizzard_StaticPopup_Game/GameDialog.lua:676>
[C]: in function 'Hide'
[Rarity_Options/Options.lua]:218: in function 'EditBoxOnEscapePressed'
[Blizzard_StaticPopup/SharedTemplates.lua]:58: in function <...faceBlizzard_StaticPopup/SharedTemplates.lua:55>

Locals:
self = StaticPopup1 {
 TopSpacer = FontString {
 }
 dirty = false
 visibleButtons = <table> {
 }
 CoverFrame = Frame {
 }
 minimumWidth = 320
 previousRegionKey = "ButtonContainer"
 widthPadding = 0
 ProgressBarSpacer = Texture {
 }
 exclusive = 1
 DarkOverlay = Frame {
 }
 timeleft = 0
 ButtonContainer = Frame {
 }
 dialogInfo = <table> {
 }
 which = "RARITY_OPTIONS_ALERT_WITH_COPY"
 hideOnEscape = 1
 ItemFrame = Frame {
 }
 MoneyInputFrame = StaticPopup1MoneyInputFrame {
 }
 AlertIcon = Texture {
 }
 ProgressBarFill = Texture {
 }
 ExtraButton = StaticPopup1ExtraButton {
 }
 Buttons = <table> {
 }
 BG = Frame {
 }
 EditBox = StaticPopup1EditBox {
 }
 ProgressBarBorder = Texture {
 }
 Dropdown = Button {
 }
 SubText = FontString {
 }
 heightPadding = 16
 Spinner = Frame {
 }
 numButtons = 2
 MoneyFrame = StaticPopup1MoneyFrame {
 }
 Text = StaticPopup1Text {
 }
 CloseButton = StaticPopup1CloseButton {
 }
 Separator = Texture {
 }
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'editBox' (a nil value)"
1x Rarity_Options/Options.lua:203: attempt to index field 'editBox' (a nil value)
[Rarity_Options/Options.lua]:203: in function 'OnShow'
[Blizzard_StaticPopup/StaticPopup.lua]:559: in function 'StaticPopup_OnShow'
[Blizzard_StaticPopup_Game/GameDialog.lua]:666: in function <...faceBlizzard_StaticPopup_Game/GameDialog.lua:665>
[C]: in function 'Show'
[Blizzard_StaticPopup/StaticPopup.lua]:390: in function <Blizzard_StaticPopup/StaticPopup.lua:277>
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: in function 'StaticPopup_Show'
[Rarity_Options/Options.lua]:225: in function <Rarity_Options/Options.lua:196>
[Rarity_Options/Options.lua]:1512: in function <Rarity_Options/Options.lua:1480>
[C]: ?
[AnnoyingPopupRemover/Libs/AceConfigDialog-3.0-87/AceConfigDialog-3.0.lua]:45: in function <...ver/Libs/AceConfigDialog-3.0/AceConfigDialog-3.0.lua:43>
[AnnoyingPopupRemover/Libs/AceConfigDialog-3.0-87/AceConfigDialog-3.0.lua]:839: in function <...ver/Libs/AceConfigDialog-3.0/AceConfigDialog-3.0.lua:661>
[C]: ?
[AnnoyingPopupRemover/Libs/AceGUI-3.0-41/AceGUI-3.0.lua]:66: in function <.../AnnoyingPopupRemover/Libs/AceGUI-3.0/AceGUI-3.0.lua:64>
[AnnoyingPopupRemover/Libs/AceGUI-3.0-41/AceGUI-3.0.lua]:300: in function 'Fire'
[AnnoyingPopupRemover/Libs/AceGUI-3.0-41/widgets/AceGUIWidget-Button.lua]:22: in function <...over/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua:19>

Locals:
self = StaticPopup1 {
 TopSpacer = FontString {
 }
 visibleButtons = <table> {
 }
 CoverFrame = Frame {
 }
 previousRegionKey = "ButtonContainer"
 ProgressBarSpacer = Texture {
 }
 exclusive = 1
 DarkOverlay = Frame {
 }
 timeleft = 0
 ButtonContainer = Frame {
 }
 dialogInfo = <table> {
 }
 which = "RARITY_OPTIONS_ALERT_WITH_COPY"
 hideOnEscape = 1
 ItemFrame = Frame {
 }
 MoneyInputFrame = StaticPopup1MoneyInputFrame {
 }
 AlertIcon = Texture {
 }
 ProgressBarFill = Texture {
 }
 ExtraButton = StaticPopup1ExtraButton {
 }
 Buttons = <table> {
 }
 BG = Frame {
 }
 EditBox = StaticPopup1EditBox {
 }
 ProgressBarBorder = Texture {
 }
 Dropdown = Button {
 }
 SubText = FontString {
 }
 heightPadding = 16
 Spinner = Frame {
 }
 numButtons = 2
 MoneyFrame = StaticPopup1MoneyFrame {
 }
 Text = StaticPopup1Text {
 }
 CloseButton = StaticPopup1CloseButton {
 }
 Separator = Texture {
 }
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'editBox' (a nil value)"
textToCopy = "Aze1Af8CahLaRmq2gG6qVP1SKW4j2anshd0U9ktRP5GiYVR+S+E6iYYSpcFIYbhUDhLBw6SqY6jjRGghEVlKgsVIleUCPEQqnqpaRnguaCJSaipVJqtkuuQiEfVNSpcpnUpKNgp0XqWymaicpmicVE0TfSZSj0nqmYpzQqOJZLxK6SRJbhFV1xD3iGKlFFmLVDpMVYPh4c2yVAgPE/DwdddZvMqTfI+nbEk1Lvxk6eDNspTqwlhoLfCGT1m8gtKwzTQu+rSohmH6EpUWb2+7RkBBEr5MyiLYxxN1EqHdEX3UDnLyxOGNTh3CwxjjJE5gAmtTM3YwzpMRS4w5icYIxpykxTTGnIRgLcac5GA9xpyEsYgxJ0mMHcacRGDMGHNGh7HAmDMKjA/GR7Qa48Q4D0mMCcZJnEbhL79sCA8TThAXHcPDl0lZBPt4ok4itDuij9pBTp44vF9lqa5CTKNQeLWUb6gtJojD+1WW6irENAqFD01pwy9lgMUrBFVClnYq0lRscjNKWmWob+hKkJHB01OagRfWpkYB"
commented

The export itself seems to be working (see textToCopy value, which is a valid export string you can use):

Aze1Af8CahLaRmq2gG6qVP1SKW4j2anshd0U9ktRP5GiYVR+S+E6iYYSpcFIYbhUDhLBw6SqY6jjRGghEVlKgsVIleUCPEQqnqpaRnguaCJSaipVJqtkuuQiEfVNSpcpnUpKNgp0XqWymaicpmicVE0TfSZSj0nqmYpzQqOJZLxK6SRJbhFV1xD3iGKlFFmLVDpMVYPh4c2yVAgPE/DwdddZvMqTfI+nbEk1Lvxk6eDNspTqwlhoLfCGT1m8gtKwzTQu+rSohmH6EpUWb2+7RkBBEr5MyiLYxxN1EqHdEX3UDnLyxOGNTh3CwxjjJE5gAmtTM3YwzpMRS4w5icYIxpykxTTGnIRgLcac5GA9xpyEsYgxJ0mMHcacRGDMGHNGh7HAmDMKjA/GR7Qa48Q4D0mMCcZJnEbhL79sCA8TThAXHcPDl0lZBPt4ok4itDuij9pBTp44vF9lqa5CTKNQeLWUb6gtJojD+1WW6irENAqFD01pwy9lgMUrBFVClnYq0lRscjNKWmWob+hKkJHB01OagRfWpkYB

Importing works as expected (tested offline, not ingame):

Decoding import string: Aze1Af8CahLaRmq2gG6qVP1SKW4j2anshd0U9ktRP5GiYVR+S+E6iYYSpcFIYbhUDhLBw6SqY6jjRGghEVlKgsVIleUCPEQqnqpaRnguaCJSaipVJqtkuuQiEfVNSpcpnUpKNgp0XqWymaicpmicVE0TfSZSj0nqmYpzQqOJZLxK6SRJbhFV1xD3iGKlFFmLVDpMVYPh4c2yVAgPE/DwdddZvMqTfI+nbEk1Lvxk6eDNspTqwlhoLfCGT1m8gtKwzTQu+rSohmH6EpUWb2+7RkBBEr5MyiLYxxN1EqHdEX3UDnLyxOGNTh3CwxjjJE5gAmtTM3YwzpMRS4w5icYIxpykxTTGnIRgLcac5GA9xpyEsYgxJ0mMHcacRGDMGHNGh7HAmDMKjA/GR7Qa48Q4D0mMCcZJnEbhL79sCA8TThAXHcPDl0lZBPt4ok4itDuij9pBTp44vF9lqa5CTKNQeLWUb6gtJojD+1WW6irENAqFD01pwy9lgMUrBFVClnYq0lRscjNKWmWob+hKkJHB01OagRfWpkYB
[IsShown] NYI   table: 0x0205a2b11490
[Show] NYI      table: 0x0205a2b11490
{
        build = 746,
        items = {
                [2] = {
                        attempts = 6,
                        chance = 250,
                        dates = {
                                [20250901] = {
                                        attempts = 6,
                                        time = 7.9399999999987
                                }
                        },
                        export = true,
                        itemId = 12662,
                        method = "NPC",
                        name = "Rune démoniaque",
                        npcs = { 14502, 7461, 14349, 11456, 11457, 11455, 11453, 11451, 11454, 11452, 11490, 11492, 13276, 14354, 14506 },
                        time = 7.9399999999987,
                        type = "ITEM"
                }
        },
        signature = "RFI2PD4jOjJ0NntgInc/ZA=="
}

Relevant information from the list of 11.2 API changes:

Various child key references on StaticPopup dialogs have been renamed.
Addons should prefer to use the new accessor methods on StaticPopup frames to access regions such as Buttons and EditBoxes.

From this I would assume Rarity's use of Blizzard's static popup widget is no longer valid:

local function alert(msg)
StaticPopupDialogs["RARITY_OPTIONS_ALERT"] = {
text = msg,
button1 = OKAY,
hideOnEscape = 1,
timeout = 0,
exclusive = 1,
whileDead = 1,
}
StaticPopup_Show("RARITY_OPTIONS_ALERT")
end
local function alertWithCopy(msg, textToCopy)
StaticPopupDialogs["RARITY_OPTIONS_ALERT_WITH_COPY"] = {
text = msg,
button1 = L["Close"],
hasEditBox = 1,
button2 = "",
OnShow = function(self)
self.editBox:SetText(textToCopy)
self.editBox:SetFocus()
self.editBox:HighlightText()
_G[self:GetName() .. "Button2"]:Hide()
_G[self:GetName() .. "Button1"]:ClearAllPoints()
_G[self:GetName() .. "Button1"]:SetPoint("TOP", self.editBox, "BOTTOM", 0, -8)
end,
OnHide = function(self)
self.editBox:SetText("")
_G[self:GetName() .. "Button2"]:Show()
end,
EditBoxOnEnterPressed = function(self)
self:GetParent():Hide()
end,
EditBoxOnEscapePressed = function(self)
self:GetParent():Hide()
end,
timeout = 0,
exclusive = 1,
whileDead = 1,
hideOnEscape = 1,
}
StaticPopup_Show("RARITY_OPTIONS_ALERT_WITH_COPY")
end

Should be an easy fix, but I don't have time to dig into the details right now. Definitely needs to be in the next release, though.

commented

Note to self (or anyone else who wants to work on this): Should also test whether the problem affects Classic.
Edit: There are several other uses of static popup dialogs throughout the codebase. Presumably, all of them would be affected.

commented

@rdw-software they changed the fields of static pop-ups,easy fix. rename lowercase editBox to EditBox

commented

Should be working again, both on Classic and Retail. I'll publish a new release shortly - let me know if there's still an issue.

Thanks again to @DakJaniels! I'll note that the new API wants addons to use accessor methods, not field names. (For... reasons?)