View Bug Report
Possible UI error when panel widget is updated
Bug #: 966
File: LibAddonMenu-2.0
Date: 07/20/14 08:23 AM
By: Garkin
Status: Fixed
There are reports with this UI error:

Code:
"Failed to create control 'LAMAddon PanelContainer1'. Duplicate name"
Example:
http://www.esoui.com/downloads/fileinfo.php?s=29acd03a5cbb9fff453910ba2fe5fe18&id=35#comments
http://www.esoui.com/downloads/info128-SkyShards.html#comments

I was trying to find out whats going on, but I'm still not completely sure. But I think that the problem is local counter in panel.lua. When panel widget is updated after one or more panels are already registered, it will show mentioned error as the new local couter will start again from 1.

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: Seerah - 07/20/14 07:52 PM
Yep, it would be the counter that would do it. When I fixed up LibMediaProvider, I also fixed the same bug with LAM. This may be what triggered this bug to finally show up.
By: Garkin - 07/20/14 08:48 PM
Maybe it is a bad question, but I always tought that when you use:
[highlight="lua"]LAMCreateControl.scrollCount = 1
local scrollCount = LAMCreateControl.scrollCount[/higlight]
You will still have local variable scrollCount with value 1.
As far as I know only tables are references to the original variable, other variables are simply copied. So I believe that your fix does not work.
By: Seerah - 07/20/14 09:20 PM
I was only thinking of LAM handling the creating itself, and not of anyone using the LAMCreateControl methods directly. ><

And I need to stop trying to fix things in a hurry while I have other things on my mind... /sigh
By: Seerah - 07/20/14 09:30 PM
/edit: scrollCount would still increment as only one copy of the function will be used by the time everything all loads into memory. But you're right. LAMCreateControl.scrollCount would not increment meaning that if any addon tried to create a panel during its Initialization then LAMCreateControl.scrollCount would not have the correct value for any later versions of LAM2 that load.

As for the error that was reported, it was because LAM2 creates panels as they are registered. (The option controls themselves aren't created until the panel is viewed for the first time.) If a panel was registered and created prior to a later version of the library loading into memory, it would give this error.