Skip to content

fix(bags): stop the options builder erroring during the search pre-build - #1235

Merged
EllesmereGaming merged 1 commit into
EllesmereGaming:mainfrom
dfrisone:bags-options-prebuild-guard
Aug 7, 2026
Merged

fix(bags): stop the options builder erroring during the search pre-build#1235
EllesmereGaming merged 1 commit into
EllesmereGaming:mainfrom
dfrisone:bags-options-prebuild-guard

Conversation

@dfrisone

@dfrisone dfrisone commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Bug

Reported by @arassu and @rekiam (Discord, v8.7.6): a red "[Bags Options ERROR] ...EUI_Bags_Options.lua:268: Wrong object type for function" prints in chat once per login. No other visible breakage.

Cause

The frameless global-search index pass that shipped in 8.7.6 runs every options page builder once (at login / first search) with the widget factory swapped to the absorber stubs, which return plain tables instead of frames. The Bags builder's region-chrome blocks feed those tables straight into real APIs: CreateFrame("Button", nil, bindRow._rightRegion) throws "Wrong object type for function" on the first inline cog.

Bags is the only module whose buildPage wraps itself in its own pcall with an unconditional chat print, which is why users see the error while other modules fail silently. The error is not harmless either: the pcall aborts the builder at the first cog block, so every setting below it on the Bags page is missing from the global search index until the page is opened live.

Fix

Guard all seven region-chrome blocks (five inline cogs, plus the Enabled Categories and Enabled Currencies dropdowns) with the established EllesmereUI._prebuilding check that GlobalSearch documents as the builder contract and that CooldownManager, DamageMeters, DataBars, QoL, ResourceBars and RaidFrames options already use.

Nothing drops out of the search index: cog popup rows and dropdown items were never search entries (only the real widget factory calls IndexSlotForSearch), and the host rows are registered by DualRow itself. Skipping the currency block during the pre-build also stops the login pass from transiently expanding and collapsing the player's currency-list headers.

Verification

Could not be tested in-game this round, so it went through a deeper static review instead: search-index parity, Spec Overrides capture, page-cache behaviour, block scoping and layout math were each verified against the widget factory and GlobalSearch sources; the guard form and comment style match the existing sites. The change is pure build-time gating of chrome that only matters on a visible page, and the guarded blocks register nothing.

Heads-up beyond this PR's scope: the same unguarded pattern exists in the buildPage paths of several other modules (Unit Frames' MakeCogBtn alone drives ~81 cog sites; Nameplates, Raid Frames, Minimap, Chat, Blizzard Skin and others have the same shape). Those fail silently and truncate their pages' search index the same way. Happy to sweep those as a follow-up if wanted.

No new options, saved variables, events, or OnUpdate; zero cost when the pre-build is not running.

Excited American Horror Story GIF

Since the frameless search index pass (v8.7.6), every options page builder
runs once at login against the absorber widget factory, which returns plain
tables instead of frames. The Bags builder's inline-cog and region-dropdown
blocks feed those tables straight into CreateFrame and SetPoint, so the
first cog block threw "Wrong object type for function". The builder's own
pcall printed "[Bags Options ERROR] ...:268: Wrong object type for
function" into chat once per login, and everything below that line on the
Bags page never registered in the global search index until the page was
visited live.

Guard all seven region-chrome blocks (five inline cogs, the Enabled
Categories and Enabled Currencies dropdowns) with the established
EllesmereUI._prebuilding check that other modules already use. Nothing
disappears from the search index: cog popup rows are not search entries,
and the host rows are registered by DualRow itself. Skipping the currency
dropdown during the pre-build also stops the login pass from transiently
expanding and collapsing the player's currency list headers.
@EllesmereGaming
EllesmereGaming merged commit 32883a4 into EllesmereGaming:main Aug 7, 2026
1 check passed
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.

2 participants