Forum Index » Technical Support »

Post a reply

joffonon
Posted 12:42AM, Monday, January 4, 2010 (2 years, 1 month ago)
#0
Hi,

Am getting an error when trying to take the gold from mails with just gold in them - either from the AH or from another character on my account. Here's the LUA error spam:

Date: 2010-01-04 08:36:55
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\CT_MailMod\CT_MailMod_OpenMail.lua line 242:
attempt to index local 'self' (a nil value)
Debug:
(tail call): ?
[C]: ?
CT_MailMod\CT_MailMod_OpenMail.lua:242: MailTo_InboxMoney_OnClick_Save()
MailTo\MailTo.lua:610:
MailTo\MailTo.lua:605

Turning off either of CT_MailMod or MailTo enables me to take the gold from the mail.

These two addons have always co-existed in the past, so I'm wondering where the problem might be since 3.3?

Thanks.
dargen
Posted 04:53AM, Monday, January 4, 2010 (2 years, 1 month ago)
#1
The error is being generated because MailTo.lua has hooked a Blizzard function which CT_MailMod is also now using, and the MailTo.lua function is not accepting, or passing on, the 'self' parameter provided by Blizzard.

I can change CT_MailMod to not use the 'self' parameter (which refers to the button used for a money attachment) since there is only one possible money attachment button. However, that won't help any other addons that also hook the same function and expect the 'self' parameter.

The best thing would be for the MailTo author to update their addon. I have posted a comment on the addon's page on Curse describing the changes that should be made. Below is a copy of those changes in case you would like to change your addon before the author updates it.


Note: The following changes refer to the "MailTo Next 1.5.9 Take 2" addon as downloaded from Curse.

If you make the following 2 changes to the MailTo.lua file it will prevent the error you are seeing.

1) Change line 605 from this:
function MailTo_InboxMoney_OnClick()

to this:
function MailTo_InboxMoney_OnClick(...)

2) Change line 610 from this:
MailTo_InboxMoney_OnClick_Save()

to this:
MailTo_InboxMoney_OnClick_Save(...)


There is another spot in MailTo.lua which also does not handle the 'self' parameter, but this one does not currently affect CT_MailMod.

3) Change line 732 from this:
function MailTo_SendName()

to this:
function MailTo_SendName(...)

4) Change line 736 from this:
if MailTo_SendName_Save then MailTo_SendName_Save() end

to this:
if MailTo_SendName_Save then MailTo_SendName_Save(...) end
Last updated by dargen
joffonon
Posted 07:38AM, Monday, January 4, 2010 (2 years, 1 month ago)
#2
Fantastic, thanks! That did the trick. :-)

Quick Reply

You cannot reply to this topic. Try logging in first.