Kiatra / ChocolateBar

ChocolateBar is a World of Warcraft addons to display plugins in a bar on top or bottom of your screen
https://www.wowace.com/projects/chocolatebar
18 stars 9 forks source link

[Bug Report] 10.1 PTR issue #29

Closed zaphon closed 1 year ago

zaphon commented 1 year ago

What game version did the bug occur in?

Retail

Troubleshooting

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)"
zaphon commented 1 year ago

Just confirming same issue does occur on live.

OttoDeFe commented 1 year ago

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.

fraerie commented 1 year ago

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.

OttoDeFe commented 1 year ago

My bad - use ChocolateBar_Mainline.toc. That's the one that stopped the error for me.

fraerie commented 1 year ago

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

  1. ChocolateBar_Mainline.toc
  2. 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

Galandel commented 1 year ago

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 10 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.

Zakarychu commented 1 year ago

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.

Galandel commented 1 year ago

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.

Kiatra commented 1 year ago

Fixed in ChocolateBar v3.11