fix(bags): stop the options builder erroring during the search pre-build - #1235
Merged
EllesmereGaming merged 1 commit intoAug 7, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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._prebuildingcheck 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 byDualRowitself. 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.