Error opening skillet after changing profile
matthewhively opened this issue ยท 6 comments
Skillet 1.38-alpha1
This type of error seems to appear after I switched to "default" profile and I browse through the plugins. It raises an error every time I click a different plugin.
The plugins configuration appears to work correctly when I switch back to my character's specific profile.
Upon logging out and then back in, the plugins config no longer exhibited the issue.
I was able to get it to occur again by switching to yet another profile I hadn't used before my realm specific profile.
I would surmise that something isn't being initialized properly upon profile switch, and that only upon initial startup (eg player entering world or whatever) is it added to the currently selected profile if it doesn't already exist.
This might be related to #53
Message: ...erface\AddOns\Skillet-Classic\Plugins\Auctioneer.lua:183: attempt to index field 'AUC' (a nil value)
Time: Wed Oct 13 23:24:50 2021
Count: 1
Stack: ...erface\AddOns\Skillet-Classic\Plugins\Auctioneer.lua:183: attempt to index field 'AUC' (a nil value)
[string "@Interface\AddOns\Skillet-Classic\UI\MainFrame.lua"]:903: in function `UpdateTradeSkillWindow'
[string "@Interface\AddOns\Skillet-Classic\UI\MainFrame.lua"]:2392: in function `ScrollToSkillIndex'
[string "@Interface\AddOns\Skillet-Classic\Skillet.lua"]:1537: in function `SetSelectedSkill'
[string "@Interface\AddOns\Skillet-Classic\UI\MainFrame.lua"]:2313: in function `SkillButton_OnClick'
[string "*:OnClick"]:2: in function <[string "*:OnClick"]:1>
Locals: self = <table> {
DeleteIgnoreEntry = <function> defined @Interface\AddOns\Skillet-Classic\UI\IgnoreList.lua:159
VendorItemAvailable = <function> defined @Interface\AddOns\Skillet-Classic\Inventory.lua:247
SkillButton_NewGroup = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:2216
mouseOver = SkilletScrollButton15 {
}
modules = <table> {
}
ClearQueue = <function> defined @Interface\AddOns\Skillet-Classic\SkilletQueue.lua:205
RecipeGroupInitFlatten = <function> defined @Interface\AddOns\Skillet-Classic\RecipeGroups.lua:433
MERCHANT_UPDATE = <function> defined @Interface\AddOns\Skillet-Classic\UI\MerchantWindow.lua:209
SkilletShow = <function> defined @Interface\AddOns\Skillet-Classic\Skillet.lua:1072
DisplayShoppingList = <function> defined @Interface\AddOns\Skillet-Classic\UI\ShoppingList.lua:1046
ShowQueueView = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:3234
SKILL_LINES_CHANGED = <function> defined @Interface\AddOns\Skillet-Classic\Skillet.lua:884
ScheduleTimer = <function> defined @Interface\AddOns\Decursive\Libs\AceTimer-3.0\AceTimer-3.0.lua:94
FilterDropDown_OnShow = <function> defined @Interface\AddOns\Skillet-Classic\UI\Filtering.lua:81
castSpellName = "Blacksmithing"
hideTrivialRecipes = false
RecipeGroupSort = <function> defined @Interface\AddOns\Skillet-Classic\RecipeGroups.lua:407
EnableResize = <function> defined @Interface\AddOns\Skillet-Classic\UI\Utils.lua:122
EnchantSpellToItem = <table> {
}
db = <table> {
}
InitializeSkillLevels = <function> defined @Interface\AddOns\Skillet-Classic\SkillLevelData.lua:294
UpdateNotesWindow = <function> defined @Interface\AddOns\Skillet-Classic\UI\RecipeNotes.lua:123
SetEnabledState = <function> defined @Interface\AddOns\Atlas\Libs\AceAddon-3.0\AceAddon-3.0.lua:424
SkilletShowWindow = <function> defined @Interface\AddOns\Skillet-Classic\Skillet.lua:1141
AdditionalButtonsList = <table> {
}
APSPlugin = <table> {
}
CHAT = <function> defined @Interface\AddOns\Skillet-Classic\DebugAids.lua:64
IgnoreList_OnScroll = <function> defined @Interface\AddOns\Skillet-Classic\UI\IgnoreList.lua:279
SortDropdown_OnLoad = <function> defined @Interface\AddOns\Skillet-Classic\UI\Sorting.lua:547
pluginsOptions = <table> {
}
UnregisterAllEvents = <function> defined @Interface\AddOns\Atlas\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:174
RecipeGroupFlatten = <function> defined @Interface\AddOns\Skillet-Classic\RecipeGroups.lua:454
RecipeGroupMoveEntry = <function> defined @Interface\AddOns\Skillet-Classic\RecipeGroups.lua:290
EnablePauseButton = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:198
ReagentButtonSkillSelect = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:2526
ShowReagentDetails = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:3125
GetTradeSkillTools = <function> defined @Interface\AddOns\Skillet-Classic\TradeskillInfo.lua:231
bopCheck = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.lua:1622
RecipeGroupClearEntries = <function> defined @Interface\AddOns\Skillet-Classic\RecipeGroups.lua:127
SkillExpandButton_OnClick = <function> defined @Interface\AddOns\Skillet-Classic\UI\MainFrame.
NOTE: this generates similar errors for each plugin when selected.
Message: ...s\Skillet-Classic\Plugins\MissingTradeSkillsList.lua:42: attempt to index field 'MTSL' (a nil value)
Time: Wed Oct 13 23:42:23 2021
Count: 1
Stack: ...s\Skillet-Classic\Plugins\MissingTradeSkillsList.lua:42: attempt to index field 'MTSL' (a nil value)
Locals: <none>
Message: ...rface\AddOns\Skillet-Classic\Plugins\AuctionLite.lua:35: attempt to index field 'ATL' (a nil value)
Time: Wed Oct 13 23:42:51 2021
Count: 1
Stack: ...rface\AddOns\Skillet-Classic\Plugins\AuctionLite.lua:35: attempt to index field 'ATL' (a nil value)
Locals: <none>
Message: ...terface\AddOns\Skillet-Classic\Plugins\AuctionDB.lua:35: attempt to index field 'AHDB' (a nil value)
Time: Wed Oct 13 23:43:18 2021
Count: 1
Stack: ...terface\AddOns\Skillet-Classic\Plugins\AuctionDB.lua:35: attempt to index field 'AHDB' (a nil value)
Locals: <none>
Message: ...erface\AddOns\Skillet-Classic\Plugins\Auctioneer.lua:35: attempt to index field 'AUC' (a nil value)
Time: Wed Oct 13 23:43:26 2021
Count: 1
Stack: ...erface\AddOns\Skillet-Classic\Plugins\Auctioneer.lua:35: attempt to index field 'AUC' (a nil value)
Locals: <none>
Message: ...rface\AddOns\Skillet-Classic\Plugins\Auctionator-100.0.11.lua:48: attempt to index field 'ATR' (a nil value)
Time: Wed Oct 13 23:43:36 2021
Count: 1
Stack: ...rface\AddOns\Skillet-Classic\Plugins\Auctionator-100.0.11.lua:48: attempt to index field 'ATR' (a nil value)
Locals: <none>
Message: ...e\AddOns\Skillet-Classic\Plugins\BootyBayGazette.lua:65: attempt to index field 'BBG' (a nil value)
Time: Wed Oct 13 23:43:43 2021
Count: 1
Stack: ...e\AddOns\Skillet-Classic\Plugins\BootyBayGazette.lua:65: attempt to index field 'BBG' (a nil value)
Locals: <none>
Message: ...rface\AddOns\Skillet-Classic\Plugins\BeanCounter.lua:35: attempt to index field 'beancounter' (a nil value)
Time: Wed Oct 13 23:43:49 2021
Count: 1
Stack: ...rface\AddOns\Skillet-Classic\Plugins\BeanCounter.lua:35: attempt to index field 'beancounter' (a nil value)
Locals: <none>
I'm pretty sure this isn't going to be the end of the changes but you're so good at finding bugs I decided to draft you.
Do to some initial work on issue #51, I already had a function (that did nothing), RefreshConfig, called when there was profile activity. In the attached Skillet.lua, I believe I have moved all the profile related initialization into functions that can be called from RefreshConfig and this should eliminate the errors you have reported so far.
What needs to be tested is various combinations of changes after a new profile is selected and do changes made in one profile remain after switching, etc. I'm going to be addressing as many of these scenarios as I can think of but you will probably think of some that I don't.
Make a copy of your global saved variables file before you start testing just to be safe. Unfortunately, comparisions using any of the programs I have installed don't work very well because of the way Lua loads and stores tables. If you use an editor that understands Lua (like NotePad++), then you can collapse the top level global and realm tables leaving profileKeys and profiles.
The goal of "Phase 1" is to make sure these changes don't introduce any regressions. I'll probably have an update shortly that will add some documentation (comments) to the code. "Phase 2" may be work to address moving the groups data into the profile.
That didn't take long, use this one instead.
There are five events associated with profile manipulation, only two of them need to initialize the profile.
self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileReset", "InitializeProfile")
self.db.RegisterCallback(self, "OnNewProfile", "InitializeProfile")
self.db.RegisterCallback(self, "OnProfileDeleted", "RefreshConfig")
Skillet-Classic-1.38-alpha2 contains this code in addition to moving some additional data into the profile space.
Skillet-Classic-1.38-alpha3 fixes a bug in alpha2 and moves custom groups into the profile space (issue #51). Code exists to move any custom groups that are defined into the profile but it hasn't been tested as much as I'd like.