Skip to content

fix(options): use the dialog's Text font string in the Hardcore import popup - #6328

Closed
GisliRAxels wants to merge 1 commit into
WeakAuras:mainfrom
GisliRAxels:fix/hardcore-import-popup-text
Closed

GisliRAxels wants to merge 1 commit into
WeakAuras:mainfrom
GisliRAxels:fix/hardcore-import-popup-text

Conversation

@GisliRAxels

Copy link
Copy Markdown

Description

On a Classic Era Hardcore realm, importing an aura that contains custom code shows WEAKAURAS_CONFIRM_IMPORT_HARDCORE, and both of its handlers throw:

WeakAurasOptions/OptionsFrames/Update.lua:1636: attempt to index field 'text' (a nil value)
WeakAurasOptions/OptionsFrames/Update.lua:1639: attempt to index field 'text' (a nil value)

Failure path on Classic Era 1.15.9 (69722):

  • Import calls StaticPopup_Show (Update.lua:1647), which calls dialog:Show() (Blizzard_StaticPopup/StaticPopup.lua:391).
  • The dialog's OnShow script is GameDialogMixin:OnShow (Blizzard_StaticPopup_Game/GameDialog.lua:690). It calls StaticPopup_OnShow, which calls this popup's OnShow.
  • StaticPopup1–4 inherit StaticPopupTemplate (GameDialog.xml:78). That template's font string is parentKey="Text" (GameDialog.xml:94), and GameDialogMixin:GetTextFontString() returns self.Text.
  • There is no .text field, so both handlers index nil.

#6323 reports that the import cannot be confirmed while this happens.

The popup is only created on Classic Era with Hardcore active (WeakAuras.IsClassicEra() and C_GameRules.IsHardcoreActive()), so it now reads self.Text directly. For comparison, WEAKAURAS_CONFIRM_REPAIR, which runs on every client, reads self.Text or self.text.

Fixes #6323

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (the reason is in the commit message)
  • I have made corresponding changes to the documentation (none needed)
  • My changes generate no new warnings (not checked locally; Luacheck runs in CI)

Written by an agent (Claude Code, claude-opus-5-5).

…t popup

On Classic Era 1.15.9, StaticPopup dialogs come from the reworked
GameDialog template: StaticPopup1-4 inherit StaticPopupTemplate, whose
font string is the Text key, and GameDialogMixin:GetTextFontString()
returns self.Text. There is no .text field, so the OnShow and OnHide
handlers of WEAKAURAS_CONFIRM_IMPORT_HARDCORE raise "attempt to index
field 'text' (a nil value)" whenever an aura with custom code is
imported on a Hardcore realm.

The popup is only created on Classic Era with Hardcore active, so it
reads self.Text directly.

Fixes WeakAuras#6323
@InfusOnWoW

Copy link
Copy Markdown
Contributor

There's already a fix for this pending.

@InfusOnWoW InfusOnWoW closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classic Era Hardcore: importing an aura with custom code fails - "attempt to index field 'text'" in the hardcore confirmation popup (Update.lua:1636)

2 participants