Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Error since latest release (r37) #3

Open
zaphon opened this issue Feb 22, 2024 · 3 comments
Open

[BUG]: Error since latest release (r37) #3

zaphon opened this issue Feb 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@zaphon
Copy link

zaphon commented Feb 22, 2024

WoW client

WoW Retail

What happened?

I have several addons that import the LibDropDownMenu library, and one of them a few days ago updated to r37. The others are at r36. Since doing so, when I attempt to right click on the LDB icon for WIM (which imports LibDropDownMenu), I get the following error.

NOTE: I installed LibDropDownMenu by it's self to ensure that it was the AddOn.

If I roll back to r36 (which involves replacing it within the AddOn that updated to r37 (DBM-Core for me)), everything is fine. Looking at the diffs between r36 and r37, it's mostly around this NewFeature functionality which it's claiming in this case is nil. I've read through the code and honestly not sure how it's nil (I even tried to force it to initialize it in the function that this is failing in), but here we are. I'm going to keep rolling back to r36 for now, but wanted you to be aware (and this is going to become more difficult as more AddOns I have update their libraries).

Lua Error Message?

1x LibDropDownMenu-37/LibDropDownMenu.lua:794: attempt to index field 'NewFeature' (a nil value)
[string "@LibDropDownMenu-37/LibDropDownMenu.lua"]:794: in function <LibDropDownMenu/LibDropDownMenu.lua:497>
[string "@WIM/Sources/ContextMenu.lua"]:119: in function `initFunction'
[string "@LibDropDownMenu-37/LibDropDownMenu.lua"]:138: in function <LibDropDownMenu/LibDropDownMenu.lua:130>
[string "@WIM/Sources/ContextMenu.lua"]:142: in function `PopContextMenu'
[string "@WIM/Modules/ldb.lua"]:41: in function `OnClick'
[string "@ChocolateBar/Chocolate.lua"]:298: in function <ChocolateBar/Chocolate.lua:295>

Other addons?

No response

@zaphon zaphon added the bug Something isn't working label Feb 22, 2024
hizuro added a commit that referenced this issue Feb 23, 2024
@hizuro
Copy link
Member

hizuro commented Feb 23, 2024

Thank you for reporting.
That was a result of different version of this lib at the same time.
r38 should fix this problem. Update coming soon.

Greetings Hizuro

@zaphon
Copy link
Author

zaphon commented Feb 24, 2024

I picked up r38 (which is funny as what you did was what I had actually done trying to fix it). I still get the same error (just the line number moved 1).

I took a look at the Update_DropDownMenuButton() function, and IMO that compare on the second line exiting seems backwards (the not seems out of place, I think you're saying if it already exists, leave), but I removed the not (heck I even commented the entire line out), and I still get the error.

That's why I said I am not sure how the heck this thing is nil!

2x LibDropDownMenu-38/LibDropDownMenu.lua:795: attempt to index field 'NewFeature' (a nil value)
[string "@LibDropDownMenu-38/LibDropDownMenu.lua"]:795: in function <LibDropDownMenu/LibDropDownMenu.lua:497>
[string "@WIM/Sources/ContextMenu.lua"]:119: in function `initFunction'
[string "@LibDropDownMenu-38/LibDropDownMenu.lua"]:138: in function <LibDropDownMenu/LibDropDownMenu.lua:130>
[string "@WIM/Sources/ContextMenu.lua"]:142: in function `PopContextMenu'
[string "@WIM/Modules/ldb.lua"]:41: in function `OnClick'
[string "@ChocolateBar/Chocolate.lua"]:298: in function <ChocolateBar/Chocolate.lua:295>

@zaphon
Copy link
Author

zaphon commented Feb 24, 2024

Actually there's something funky going on with the way different versions of the addon load / interact with each other. I know the LibStub behavior works for the main LUA file, but not sure what (if anything) it's doing for the additional files. As a test, I replaced the LibDropDownMenu files in the 3 addons I have with it and it's working now.

Broker_Everything (I think that's yours, it was at r35 I believe)
DBM-Core (r37)
WIM (r36)

And while I loaded LibDropDownMenu (r38) as it's own AddOn, it was still misbehaving. But as soon as I put all the files for r38 into every addon above (so they're all at r38 now). Works fine.

I had also tried moving the addon to !LibDropDownMenu and even ZZLibDropDownMenu to figure out what was going on (including adding prints into the Update_DropDownMenuButton() function which is how I knew it wasn't getting called in the main AddOn (it appears it was calling the one in the r37 version of the addon loaded by DBM-Core as that function existed there as well)). So as I said, things aren't working as expected (every other library I looked at that uses the LibStub functionality to handle loading the latest version only has a single LUA file, you're loading 4)

I'm far from a wow addon expert, so I'll leave it to you to ponder this situation (pretty easy to recreate my environment, all the addons above are the latest versions, and unfortunately most addons no longer ship with a -nolibs version like they did in the old days).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants