[Bug Report] 10.1 PTR issue
zaphon opened this issue ยท 9 comments
What game version did the bug occur in?
Retail
Troubleshooting
- I have verified that ChocolateBar is up to date.
- I have tried to reproduce the bug with no other addons loaded.
- I have verified that the issue hasn't yet been reported.
Describe the bug.
I'm on the 10.1 PTR (same version that's going live today) and I am getting the following error from ChocolateBar on load (it creates several errors but it's all tied to this one).
4x ...ddOns/ChocolateBar/modules/CB_PlayedTime_Options.lua:5: bad argument #1 to 'GetAddOnMetadata' (Invalid AddOn name CB_PlayedTime. - Usage: local value = C_AddOns.GetAddOnMetadata(name, variable))
[string "=[C]"]: in function `GetAddOnMetadata'
[string "@ChocolateBar/modules/CB_PlayedTime_Options.lua"]:5: in main chunk
Locals:
(*temporary) = "CB_PlayedTime"
(*temporary) = "X-Curse-Packaged-Version"
(*temporary) = "Invalid AddOn name CB_PlayedTime. - Usage: local value = C_AddOns.GetAddOnMetadata(name, variable)"
For now I fixed the bug by simply changing the failing line to
--local version = GetAddOnMetadata("CB_PlayedTime","X-Curse-Packaged-Version") or ""
local version = ""
Steps to reproduce.
Login to 10.1 PTR with the ChocolateBar addon loaded.
Expected behavior.
Not to throw errors.
Errors
4x ...ddOns/ChocolateBar/modules/CB_PlayedTime_Options.lua:5: bad argument #1 to 'GetAddOnMetadata' (Invalid AddOn name CB_PlayedTime. - Usage: local value = C_AddOns.GetAddOnMetadata(name, variable))
[string "=[C]"]: in function `GetAddOnMetadata'
[string "@ChocolateBar/modules/CB_PlayedTime_Options.lua"]:5: in main chunk
Locals:
(*temporary) = "CB_PlayedTime"
(*temporary) = "X-Curse-Packaged-Version"
(*temporary) = "Invalid AddOn name CB_PlayedTime. - Usage: local value = C_AddOns.GetAddOnMetadata(name, variable)"
To stop the error until it's fixed, I added "## " before the last three lines in the toc (where CB_PlayedTime is pointed to), then the played time module doesn't load.
My bad - use ChocolateBar_Mainline.toc. That's the one that stopped the error for me.
My bad - use ChocolateBar_Mainline.toc. That's the one that stopped the error for me.
OK - I finally managed to solve my other ChocolateBar issue also:
There are two Mainline.toc files
- ChocolateBar_Mainline.toc
- ChocolateBar-Mainline.toc
In order to stop the CB_playedtime error I had to comment out the modules in the second file. I noticed that it also didn't have the jostle2 module listed, whereas the first toc file did. When I added the jostle2 module to the list it stopped throwing the jostle error that's been bugging me since 10.0.5
To stop the error until it's fixed, I added "## " before the last three lines in the toc (where CB_PlayedTime is pointed to), then the played time module doesn't load.
I tried this and am still getting the same error - I have even done a fresh install and blown away me previous preferences and re-set up Chocolate bar from scratch.
Not sure if this is the correct fix or not but to get rid of the GetAddOnMetadata error, I did the following in modules/CB_PlayedTime_Options.lua:
- Comment out line 5 (Put -- at the beginning of the line)
-- local version = GetAddOnMetadata("CB_PlayedTime","X-Curse-Packaged-Version") or ""
- Changed line 10 from:
name = addonName.." "..version,
toname = addonName,
No more errors from the addon. Again not sure if this is the right fix, but seems to work.
Not sure if this is the correct fix or not but to get rid of the GetAddOnMetadata error, I did the following in modules/CB_PlayedTime_Options.lua:
1. Comment out line 5 (Put -- at the beginning of the line) `-- local version = GetAddOnMetadata("CB_PlayedTime","X-Curse-Packaged-Version") or ""` 2. Changed line 5 from: `name = addonName.." "..version,` to `name = addonName,`
No more errors from the addon. Again not sure if this is the right fix, but seems to work.
Did you mean line 10 under your section 2?! You wrote two times line 5, quite confusing.
My apologies for the typo, yeah, I meant line 10. I have updated my post to correct the error. Teach me to post late at night, lol. I did try to look at how other addons handled GetAddonMetadata
but couldn't get it to work in this addon. Commenting it out though seems to work well for me.