1 of 2
1
Freeform insert_end hook Bug
Posted: 19 December 2007 10:26 AM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2007-11-15

I’ve been battling against this issue for the last few hours and I’ve reached the end of my ideas, so I thought I’d post and see what comes of it.

I’ve written an extension which uses the freeform_module_insert_end hook to perform some extra actions after adding to the database. Sadly I’m receiving the following error messages when it’s in place.

NoticeUndefined variablemsg in /web/www.idworks.ie/current/public/core/modules/freeform/mod.freeform.php on line 1354

Warning
Cannot modify header information headers already sent by (output started at /web/www.idworks.ie/current/public/core/modules/freeform/mod.freeform.php:1354in /web/www.idworks.ie/current/public/core/core/core.functions.php on line 296 

From the look of things $msg seems to be undefined. It gets set in the code which checks whether to send notifications, and the code which sends a response to the user, but after each it is unset.

Originally I was using version 2.5.2 but the problem has persisted since I updated to 2.6.0. Expression Engine is at version 1.6.1 (build 20071204).

Steve
Any ideas?

Profile
 
 
Posted: 04 February 2008 11:17 PM   [ Ignore ]   [ # 1 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-03-17

Yeah I just found this issue as well… The variable is unset on line: 1263 of mod.freeform.php. My solution was just to take it out of the extension call as I did not need it…. not sure what commenting out the unset would do. Hope that helps.

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More EE Extensions & Modules 20+

Profile
 
 
Posted: 06 February 2008 06:58 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

The extension hook bugs have been corrected in the latest version of Freeform: Freeform 2.6.2

 Signature 
Profile
 
 
Posted: 06 February 2008 02:00 PM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2007-03-17

Excellent… cheers!

 Signature 

Newism - Newcastle Web Design & Development
 
LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator | LG TinyMCE | LG Twitter

More EE Extensions & Modules 20+

Profile
 
 
Posted: 19 July 2008 09:11 AM   [ Ignore ]   [ # 4 ]
Member
Avatar
RankRankRank
Total Posts:  153
Joined  2006-09-11

I’m using 2.6.5 and $msg isn’t even showing in the hook:

if (isset($EXT->extensions['freeform_module_insert_end']))
  
{
   $edata 
$EXT->call_extension('freeform_module_insert_end'$fields$this->entry_id);
   if (
$EXT->end_script === TRUE) return;
  

Is that correct? Has this been removed?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 30 September 2008 03:58 AM   [ Ignore ]   [ # 5 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

The hook still does not seem to function correctly in 2.6.6

I get

Undefined variable: msg ... on line 1363

Tested without any parameters, with notifiy parameters.

Dear solspace developers, please fix this hook so that we can actually start using it.

Profile
 
 
Posted: 30 September 2008 06:37 AM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

I’ll see if I can get a developer to stop by smile

 Signature 
Profile
 
 
Posted: 01 October 2008 06:36 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

Hey guys…

Test this out and let me know if it works smile

File Attachments
mod.freeform.php.zip  (File Size: 16KB - Downloads: 241)
 Signature 
Profile
 
 
Posted: 01 October 2008 09:07 AM   [ Ignore ]   [ # 8 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

Hi Pie Man

First tests seem to work just fine, i’m getting the desired output when debugging. The $msg variable is now there.
Let me do some more extensive testing, I’m in the midst of writing an extension.

Regards
Peter.

Profile
 
 
Posted: 01 October 2008 10:06 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

Thanks Peter smile

 Signature 
Profile
 
 
Posted: 01 October 2008 10:31 AM   [ Ignore ]   [ # 10 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

Just noticed. We have the $msg variable, however the email message gets sent before the hook in the code, which makes the hook quite unusable, at least in terms of the message.

Would it be possible to either move it or add another hook so that we can change or append something to the content of the message?

Profile
 
 
Posted: 06 October 2008 12:23 AM   [ Ignore ]   [ # 11 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

Any updates on this?

We have a nice extension waiting to release but without a proper access to the message sent to the users that have to be notified, it’s only half way there and the hook seems useless.

Let us know if we can help to fix this.

Profile
 
 
Posted: 06 October 2008 06:40 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

Sorry pesche,

I’m waiting on Mitchell for this one…

 Signature 
Profile
 
 
Posted: 12 October 2008 09:02 AM   [ Ignore ]   [ # 13 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

*bump*

It’s been almost a week now. Still no news? This is pretty easy to fix.

Profile
 
 
Posted: 12 October 2008 12:44 PM   [ Ignore ]   [ # 14 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10254
Joined  2006-10-18

So I’m told that the extension hook you’re using is not intended to function this way…
Mitchell has created two new extension hooks…

freeform_module_admin_notification
This one allows someone to alter the $msg variable before an admin email is sent to anyone specified in the ‘notify’ param.

freeform_module_user_notification
This one allows someone to alter the $msg variable before a user email is sent to the person submitting a form.

See if this attached file solves this for you guys smile

File Attachments
mod.freeform.zip  (File Size: 17KB - Downloads: 255)
 Signature 
Profile
 
 
Posted: 12 October 2008 01:25 PM   [ Ignore ]   [ # 15 ]
Newbie
Avatar
Rank
Total Posts:  13
Joined  2008-04-14

Hi

Thanks for getting back, we’ll have a look at this as soon as possible.

So the hook freeform_module_insert_end is there only for altering the $msg content, for let’s say displaying it somewhere after the form was submitted?

Finally, you can access the message that was emailed to the notification list through the $msg variable.

Profile
 
 
   
1 of 2
1