Thread Tools Display Modes
05-23-20, 10:02 AM   #1
kaytotes
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 18
UIDropDownMenu Assumed Taint

I try to avoid posting bothering people on here with something that is probably trivial but I'm stumped and at my whits end. As far as I know this was working fine with 8.1 and 8.2 so maybe I missed something about API changes with 8.3.

Basically I'm getting the following in at least 2 places that have been found so far.

https://github.com/kaytotes/Improved...dUI/issues/139
https://github.com/kaytotes/Improved...dUI/issues/140

Clicking "Guild" on my micro menu.

The specific line in question being: https://github.com/kaytotes/Improved....lua#L108-L112

Code:
29x FrameXML\UIDropDownMenu.lua:340: attempt to index local 'listFrame' (a nil value)
[string "@FrameXML\UIDropDownMenu.lua"]:340: in function `UIDropDownMenu_AddButton'
[string "@Blizzard_Communities\ClubFinder.lua"]:559: in function `initFunction'
[string "@FrameXML\UIDropDownMenu.lua"]:76: in function `UIDropDownMenu_Initialize'
[string "@Blizzard_Communities\CommunitiesSettings.lua"]:43: in function <Blizzard_Communities\CommunitiesSettings.lua:34>
[string "=[C]"]: in function `LoadAddOn'
[string "@FrameXML\UIParent.lua"]:457: in function `UIParentLoadAddOn'
[string "@FrameXML\UIParent.lua"]:707: in function `Communities_LoadUI'
[string "@FrameXML\UIParent.lua"]:973: in function `ToggleCommunitiesFrame'
[string "@FrameXML\UIParent.lua"]:828: in function <FrameXML\UIParent.lua:807>
[string "=[C]"]: in function `securecall'
Attempting to favourite a set in collections.

Code:
31x FrameXML\UIDropDownMenu.lua:340: attempt to index local 'listFrame' (a nil value)
[string "@FrameXML\UIDropDownMenu.lua"]:340: in function `UIDropDownMenu_AddButton'
[string "@Blizzard_Communities\ClubFinder.lua"]:559: in function `initFunction'
[string "@FrameXML\UIDropDownMenu.lua"]:76: in function `UIDropDownMenu_Initialize'
[string "@Blizzard_Communities\CommunitiesSettings.lua"]:43: in function <Blizzard_Communities\CommunitiesSettings.lua:34>
[string "=[C]"]: in function `LoadAddOn'
[string "@FrameXML\UIParent.lua"]:457: in function `UIParentLoadAddOn'
[string "@FrameXML\UIParent.lua"]:707: in function `Communities_LoadUI'
[string "@FrameXML\UIParent.lua"]:973: in function `ToggleCommunitiesFrame'
[string "@FrameXML\UIParent.lua"]:828: in function <FrameXML\UIParent.lua:807>
[string "=[C]"]: in function `securecall'
[string "@ImprovedBlizzardUI\modules/bars/micromenu.lua"]:111: in function `func'
I've bounced around over the years so have seen the various issues with dropdown taint and have tried to pull in these two libs on seperate occasions to try solve the problem. Thinking this was the right course of action.

https://www.wowace.com/projects/libuidropdownmenu
https://www.wowinterface.com/downloa...pDownMenu.html

I build the micro menu here: https://github.com/kaytotes/Improved...romenu.lua#L39
Use it here: https://github.com/kaytotes/Improved...romenu.lua#L69

Swapping those out for the above replacements however hasn't solved the problem that I expected.

I am using the following 3rd party libs and wondered if maybe they could somehow be a cause but doubt it: LibStub, Ace3, CallbackHandler-1.0, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets.

Basically. What am I doing wrong?

Last edited by kaytotes : 05-23-20 at 10:06 AM.
  Reply With Quote
05-23-20, 07:23 PM   #2
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
This is not a taint, since the error message say the "listFrame" doesn't existed, so according to the code line

Lua Code:
  1. local listFrame = _G["DropDownList"..level];

The ui drop down menu provided by the blz has only two levels, limited by "UIDROPDOWNMENU_MAXLEVELS". So if you want use more levels, the error will be raised. I don't check the 3rd libs, according to the page, if you use NoTaint UIDropDownMenu, you may change the LIB_UIDROPDOWNMENU_MAXLEVELS to a more big value.

If you still have problem, I also have a lib for drop down menu, you can search ShowDropDownMenu in https://github.com/kurapica/Scorpio/.../004.widget.md
  Reply With Quote
05-24-20, 04:02 PM   #3
kaytotes
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 18
I'm sorry but I do not understand your solution. Changing that constant doesn't solve the problem either and I still get the listFrame error.

My question is why am I getting this error? I don't even know what a listframe is.
  Reply With Quote
05-24-20, 04:42 PM   #4
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
There is a huge bug IMO in the blizzard code.


ClubFinder.lua:559

Lua Code:
  1. UIDropDownMenu_AddButton(info, level);

In this code "level" is a GLOBAL!

This means that it could be interacting with other code that sets the global "level" variable!

So if you are lucky that level variable will be nil, and when you call into AddButton, it will get set to 1 by this code

Lua Code:
  1. if ( not level ) then
  2.         level = 1;
  3.     end


So, that is all well and good - but it is breaking for you. So let check out your code to see if you might be using the same variable.

https://sourcegraph.com/github.com/k...yer.lua#L121:5

You also appear to be writing to the global "level" variable

Lua Code:
  1. level = UnitLevel('player');

You should try to avoid writing to global variables if at all possible. Cheers!
  Reply With Quote
05-24-20, 05:00 PM   #5
kaytotes
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 18
Oh my god that's it as soon as I saw it clicked.

I'd just been going through my .TOC file and removing modules line by line to find a culprit for the error and narrowed it down to my player.lua and target.lua

I'll make a far more concerted effort to use local wherever appropriate! Thank you so much i've been tearing my hair out for a couple weeks.
  Reply With Quote
05-24-20, 05:35 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by kaytotes View Post
Oh my god that's it as soon as I saw it clicked.

I'd just been going through my .TOC file and removing modules line by line to find a culprit for the error and narrowed it down to my player.lua and target.lua

I'll make a far more concerted effort to use local wherever appropriate! Thank you so much i've been tearing my hair out for a couple weeks.

don't forget you can also use addon wide variables via the shared table you can access at the top of each lua file.

If you have never used it, do something similar to the following at the top of any file you want to access the addon wide table. The second line is just something I add in case it is initially nil rather than an empty table.
local addonName, addonData = ...
addonData = addonData or {}

I use local for variables that are only needed for that file, or within code blocks and anything that I need access to across the whole addon I used the addonData table. This enables me to separate functionality across multiple files, which enables me to better share individual files with other addons that need the same functionality. Such as Translation tools.
__________________
  Reply With Quote
05-25-20, 08:49 AM   #7
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Dont feel bad it seems there are quite some addons using level as a global ...

https://www.townlong-yak.com/globe/wut/#q:level
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » UIDropDownMenu Assumed Taint

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off