1 March 2005

Getting MT-Mail-Entry 2.0 working in MT 3.1x

Several MT enthusiasts are reporting that Stepan Riha’s MT-Mail-Entry 2.0 throws an error as of MT 3.1 on up;

Can't call method "param" on an undefined value at mt-mail-entry.cgi line 54

Here’s a quick fix.

Short and sweet, this one is (and Yoda I am not by a longshot - ahem). Replace the line that reads:

my $q = $app->{query};

with:

my $q = CGI->new;

It should now work! Since I saw reports of this working pre-3.1, I’m guessing that the 2.6x version of MT provided access to the CGI query via MT::App. If so, that’s either no longer true or perhaps said access has moved elsewhere within MT::App. I didn’t catch any notable clues while debugging the CGI, but no matter - this ought to do the trick. Enjoy …

Or rather, I will enjoy … once I nail down a reasonable game plan to keep it from being flagrantly abused. (If anyone has suggestions, by all means … and yes, I’ve already changed the name of the CGI. Heh-heh.)

Posted by joe at 01:11 AM

Trackback Pings

TrackBack URL for this entry:
http://www.joesapt.net/mt/mt-tb.fcgi/9

Comments

rowan of Uncommon Thought Journal writes:

Thanks for working on this. I finally got it to work in an upgraded version, but not a new install. This will help tremendously. I love this plugin. It adds nice functionality to MT.

# 1 March 2005, 08:51 AM -05:00

Joe writes:

This just in: While traipsing around lib/MT/App.pm I came across the setup for the CGI query within the App object. It’s there safe ‘n sound. It didn’t go anywhere. In fact, it’s used all over the Comments module, among other places.

Soooo … I’m still not sure why the query winds up being undefined. It looks like it’s being used correctly, but I suppose I’m missing something more subtle here. (This would be a good time for me to take a crash course on writing MT Plugins/CGIs … I was looking for an ideal oppy, and I suppose this must be it!)

Ahh well, all good intentions. Stay tuned …

# 1 March 2005, 06:04 PM -05:00

Joe writes:

[Browsed plugin tutorial, skimmed through APIs.] Well, that was quick. :-)

It turns out that, while a lot of plugins/extensions use App.pm, even MT’s own mt-send-entry.cgi uses (drum roll) … CGI.pm, and by that I mean only CGI.pm - no using the App module at all.

Here’s where it gets interesting. It turns out that App.pm takes some additional things into account, namely whether you use Apache and mod_perl, plus your CGIMaxUpload setting. Using mod_perl in particular means MT would not use CGI.pm to fetch the query. The plot thickens.

# 1 March 2005, 06:42 PM -05:00

Paul of Speth.tv writes:

I uploaded Stepan Riha’s MT-Mail-Entry 2.0 to create a pop-up send mailer. I uploaded mt-mail-entry.cgi in my MT directory (cgi-bin) and created two MT templates (mail_entry_text & mail_entry_html). I changed the code as you stated above to fix the “param” call method error. My problem is that I can send emails to my domain at speth.tv but when trying to send to someone at yahoo.com or aol.com, I get the following error:

Failed to send email: Error sending mail: RCPT TO: error (553 sorry, that domain isn’t allowed to be relayed thru this MTA (#5.7.1))

Is there any feedback on this issue? Thanks for the help so far.

# 15 March 2005, 12:52 PM -05:00

leo prieto of Leo Prieto is News - Cooking the Internet soup since 1996 writes:

thanks! millions, and millions of it.

# 31 March 2005, 05:06 PM -05:00

Martin Fuchs of HASH(0x9b33b70) writes:

hi together, i was just trying to get that to work. the changing of the cgi script as stated above helped me to get rid of this first error. now the message form opens but after sending it i get the following error: Got an error: Not a subroutine reference at /is/htdocs/wp1005496_5PZE0VCZ8R/mt/lib/MT/Mail.pm line 105. could anyone probably help me telling me what that means? thanks a lot, martin

# 13 July 2005, 06:14 PM -05:00

Amirreza of writes:

how change the sourse of this script to send the e-mail to more friends by “,”? example: Recipient email address : e-mail@yahoo.com,e-mail2@gmail.com,…. please help me!

# 8 April 2006, 08:04 AM -05:00

Joe writes:

Amirreza: I’m not sure why that wouldn’t work out-of-the-box, unless the script is actively enforcing a single email address, which it might be doing to prevent abuse of the email form.

# 8 April 2006, 08:09 AM -05:00

Amirreza of دانلود نرم افزارهای جدید writes:

ok please visit this one… e-card.shahkey.com this is an greeting card system… i want this feature for my visitors to send an e-card to their frinds… so i can’t insert this feature to mt-mail-entry!! can i?!

# 10 April 2006, 12:58 PM -05:00

Joe writes:

Amirreza - I don’t believe you can use mail entry for the e-card. Only for mailing a copy of a previous Movable Type post. Best bet though is to check with the original author (see link at top of this post). There may be a way around that!

# 10 April 2006, 09:10 PM -05:00

amirrzea of writes:

thank U

# 12 April 2006, 01:32 PM -05:00

Comments are closed for this entry.