Thread Tools Display Modes
10-16-10, 12:01 PM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 149
[HELP] Error on Show() with patch 4.01

Hello,

Since patch 4.01, several addons cause a LUA error:
"[string "ChatKeysOptName:OnShow"]:1: attempt to index global 'this' (a nil value)"

This error appears when attempting to show a frame with myFrame:Show()

The XML file contains:
Code:
<EditBox name="ChatKeysOptName" inherits="InputBoxTemplate"  [...]
  <Scripts>
      <OnShow>
           this:SetText(videSiNul(ChatKeysDatas["buddyName"]));
       </OnShow>
   </Scripts>
</EditBox>
How could I fix this error? I guess the patch introduces a new syntax.

Thanks for your help.
  Reply With Quote
10-16-10, 12:08 PM   #2
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
* The global variables this, event and arg1[b], [b]arg2... have been removed. Event handlers and other callbacks must use the appropriate locals. If you have lua installed locally, the command luac -l -p somefile.lua can be useful to search for the GETGLOBAL instruction to find places where code is referencing a global instance of these variables.
http://forums.worldofwarcraft.com/th...99864&sid=2000
__________________
Oh, the simulated horror!
  Reply With Quote
10-16-10, 03:54 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If the only error is triggered by the section of XML you posted, you should be able to solve the problem by replacing "this" with "self". If there are other errors occurring, post the sections of code triggering them.
  Reply With Quote
10-17-10, 05:46 AM   #4
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 149
Thanks for these infos, it works now
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » [HELP] Error on Show() with patch 4.01


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