Skip navigation
Brian Michel
Currently Being Moderated

Email Trigger in PHP 5.2.10

Aug 6, 2009 5:00 PM

All of a sudden, all my sites' registration pages now fail when my server was updated to PHP 5.2.10.

 

It cannot send the activation or welcome mail causing the triggers to fail and has rendered ADDT registration useless.

 

Any thoughts on where to even look to solve this problem? I have poked around in the includes folder but still no luck.

 

Thanks,

 

Brian

 
Replies
  • Currently Being Moderated
    Aug 6, 2009 5:15 PM   in reply to Brian Michel

    Hmmm....  Could this be one of the reasons why ADDT was withdrawn from the market ?

     

    Thanks for the heads up on PHP 5.2.10. I am currently planning to upgrade my server to that which will have a serious impact on my sites.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2009 6:43 PM   in reply to Brian Michel

    Hi,

     

    I've gone as high as 5.2.9-2 on my test server with no issues but when I change it to 5.3.0 it stops working. I don't know about 5.2.10

     

    Here is a list of the depreciated 5.3.0 functions, which ADDT uses some.

     

    http://php.net/manual/en/migration53.deprecated.php

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 8:27 AM   in reply to Albert S.

    Albert S. wrote:

     

    Hi,

     

    I've gone as high as 5.2.9-2 on my test server with no issues but when I change it to 5.3.0 it stops working. I don't know about 5.2.10

     

    Here is a list of the depreciated 5.3.0 functions, which ADDT uses some.

     

    http://php.net/manual/en/migration53.deprecated.php

    Hi Albert (and of course everyone else stumbling across this issue),

     

    just a quick note, and only in regards to the possible reason why ADDT´s Email Trigger will cease to work with PHP 5.3.0: For the email stuff ADDT is using an outdated version of the PEAR Email classes which can be found in "includes\common\lib\email\Pear\".

     

    The real troublemaker in this case appears to be the file PEAR.php itself, as this ones makes a call to the deprecated function dl() within the function loadExtension -- other than this I didn´t find any references to this very function in any other ADDT "includes" file, so...

     

    What sorta puzzles me is that the latest of PEAR.php you can download from the pear website still makes a reference to this function, so I don´t know if replacing the old with the updated file would help or not -- however it seems that the currently available PEAR version is still in legacy mode for PHP 4.x, but AFAIK they´re heading for a PEAR2/Pyrus - version which is said to support PHP version 5.3 and higher.

     

    Hope this information is at least partially helpful ;-)

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 8:56 AM   in reply to Brian Michel

    Brian Michel wrote:

     

    Albert,

     

    Thanks so much... I bet that's the issue. I wouldn't doubt if 5.2.10 was set up to be the release candidate for 5.3.

     

    I am going to try to manually rework my registration form, perhaps using WebAssist stuff instead to handle the registration and activation email.

     

    I will continue to look through the ADDT library to see if there are any changes that can be made there but it appears that ADDT will become a dying beast if requires too many depricated functions.

     

    Cheers,

     

    Brian

     

    Hi Brian,

     

    out of curiosity I´ve just scanned all of ADDT´s "includes" files (only the PHP files of course ;-) for any of the functions which are deprecated in PHP 5.3. From what I found out, ADDT seems to use the deprecated functions split() and mysql_escape_string() in a small number of files only-- and here´s where I found them:

     

    --------------------------------------------------------------

    Deprecated functions found in ADDT´s include files

    --------------------------------------------------------------

     

    1. function split() found in:

     

    - includes\common\lib\file\KT_File.class.php

    - includes\common\lib\file_upload\KT_FileUpload.class.php

    - includes\common\lib\folder\KT_Folder.class.php

    - includes\common\lib\image\KT_Image.class.php

     

    occurences found: one instance per file

    possible fix: try replacing with preg_split()

     

     

    2. function mysql_escape_string() found in:

     

    - includes\common\lib\db\KT_FakeRecordset.class.php

     

    occurences found: three instances

    possible fix: try replacing with mysql_real_escape_string()

     

     

    Other than that a handful of other ADDT files make an ini_get() - call to some deprecated PHP.INI functions such as safe_mode -- but I´m not sure if this would trigger errors, because ADDT just tries to retrieve the related INI values and doesn´t atempt to change them.

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 9:44 AM   in reply to Brian Michel

    Brian Michel wrote:

     

    Gunter,

     

    Danke Schon! Du bist ein genialer Mensch!

     

    woahh -- thanks so much :-)

     

    I will see what I can do to get this to work on 5.2.10+

     

    I reckon that it should work the same under 5.2 and below, because the functions preg_split() and mysql_real_escape_string() are of course available in older PHP versions too.

     

    Gotta tell you something: the ADDT developers did in fact implement the function preg_split() in zillions of other files -- it´s just that they apparently forgot to update those few files accordingly :-)

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 11:35 AM   in reply to Günter Schenk

    Thank you so much for starting to check into ADDT and PHP 5.3.0.

     

    I know with the functions they give alternates to use so changes those can be fairly easy to fix. My worry is about the deprecated features, specifically the first one. Does ADDT use the Assigning of the return value with a new = reference?

     

    Deprecated features:

    • Assigning the return value of      new by reference is now      deprecated.
    • Call-time pass-by-reference is now deprecated.
    • The use of {} to access string offsets is deprecated.      Use [] instead.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 12:14 PM   in reply to Albert S.

    I know with the functions they give alternates to use so changes those can be fairly easy to fix. My worry is about the deprecated features, specifically the first one. Does ADDT use the Assigning of the return value with a new = reference?

     

    Deprecated features:

    • Assigning the return value of      new by reference is now      deprecated.
    • Call-time pass-by-reference is now deprecated.
    • The use of {} to access string offsets is deprecated.      Use [] instead.

    Hi Albert,

     

    yeah I´ve been reading about that too, but it´s not something I can answer that easily -- this would be much harder to scan ;-)

     

    Right now I don´t have PHP 5.3.0 installed on my local server, means I can´t test what exactly happens in case ADDT should use any of that stuff, so it seems some other ADDT user equipped with 5.3.0 will have to give some feedback in case he/she should stumble across previously unseen error messages such as...

     

    Warning: call-time pass-by-reference has been deprecated - argument passed by value;

     

    ..which of course indicates the usage of the call-time pass-by-reference feature.

     

    Calling upon the user crowd:: does anyone indeed get such error messages with ADDT on PHP 5.3.0 ? If so, please be so kind to report it here. Thanks !

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 12:37 PM   in reply to Günter Schenk

    Hi,

     

    I can provide you with some warning messeges Gunter. I have a WAMP test server installed with 3 different versions of PHP so switching between them is just a few clicks away.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 12:59 PM   in reply to Günter Schenk

    What I just found out about the "Assigning the return value of  new by reference is now deprecated" thingy :: one would have to scan for the string "& new" (e.g. & new functionnamehere), and it´s indeed used by ADDT -- but actually only once, and guess where it is ? Not in ADDT´s own code actually, but - again - in the outdated PEAR mail classes. More precisely said: you can find one instance of that in the file "includes\common\lib\email\Pear\Mail\smtp.php", and it seems obvious that only users using the SMTP protocol will be affected.

     

    Cheers,

    Günter

     

    Update: you can additionally detect the string "&new" in the PEAR files "PEAR.php" and "Mail.php" -- this means: more trouble to be expected for more users, but at least it seems possible to isolate the problem.

     

    Update 2: anyone who´s affected by the "Assigning the return value of  new by reference is now deprecated" error on PHP 5.3.0, should try doing away with the extra "&" char to get this issue resolved: I´ve just stumbled acrosss this article which:nicely describes why this happens and what to do.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 12:58 PM   in reply to Günter Schenk

    Here is one of the first ones I get on an insert/email form.

     

    Fatal error:  Call to undefined method tNG_fields::tNG_fields() in C:\wamp\www\dfa\includes\tng\tNG_insert.class.php on line 30

     

    When going thru the code you need to actually look at tNG_fields.class.php since that method is not being defined.

    When I look at tNG_fields.class.php there are several instances that use a command line like..

     

    return new tNG_error('code in here changes within different functions but over all structure is similar within a few different functions in this page');

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 1:50 PM   in reply to Albert S.

    Albert S. wrote:

     

    When I look at tNG_fields.class.php there are several instances that use a command line like..

     

    return new tNG_error(...');

     

    I´d say that something like "return new whateverfunction" is in itself perfectly valid, and it´s not the same as the call-time pass-by-reference thing:

     

    Some examples of how a call-time pass-by-reference instance actually looks like:

     

    - & new

    - function whatever ( &$var )

     

    There are indeed some ADDT functions which do use the function whatever ( &$var ) - notation, means a call-time pass-by-reference for the function arguments. Just search for the string "(&$" - without the quotes of course -and you´ll find plenty of ADDT PHP files (I found 54 files) which make use of this.

     

    Who might encounter issues with this ? PHP 5.3.0 users of course, but this can also happen with previous 5.x.x versions in case those "features" have been explicitely turned off in php.ini. The only difference is: in PHP versions prior 5.3.0 you´re allowed to turn them on again, but in 5.3.0 (and apparently future versions) you can´t, because they´re gone once and for all.

     

    What to do ? I´ve just stumbled across plenty of related articles which claim that simply doing away with the "&" even for function paramaters did solve this issue without breaking the functionality.

     

    Cheers,

    Günter

     

    P.S. if you´re curious, just google for those error messages -- you´ll now find plenty of related "help me" questions in various product forums like e.g. Joomla, and not surprisingly many of them are related to running Joomla et al on PHP 5.3.0 ;-)

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 1:21 PM   in reply to Albert S.

    I think I found your answer - I encountered the same problem.

     

    http://www2.interaktonline.com/Products/Bundles/MXKollection/Product-F orum/Details/142122/ADDT+DEAD.html?pageNum_rsMessages=0&totalRows_rsMe ssages=23&threaded=F&sort=DESC

     

    Editing the following files will work:

     

    Look inside includes/tng/tNG_insert.class.php, tNG_update.class.php, tNG_delete.class.php  and tNG_custom.class.php and replace parent::tNG_fields($connection); with parent::tNG($connection);

    This will fix your error.

     

    I tried it and it's working fine now.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 3, 2009 9:14 AM   in reply to Günter Schenk

    --------------------------------------------------------------

    Deprecated functions found in ADDT´s include files

    --------------------------------------------------------------

     

    1. function split() found in:

     

    - includes\common\lib\file\KT_File.class.php

    - includes\common\lib\file_upload\KT_FileUpload.class.php

    - includes\common\lib\folder\KT_Folder.class.php

    - includes\common\lib\image\KT_Image.class.php

     

     

    I opened these files, but i didn't find any "function split()" occurancies.

    Are there different versions of ADDT?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 3, 2009 11:18 AM   in reply to eagle-waa

    eagle-waa wrote:

     

     

    --------------------------------------------------------------

    Deprecated functions found in ADDT´s include files

    --------------------------------------------------------------

     

    1. function split() found in:

     

    - includes\common\lib\file\KT_File.class.php

    - includes\common\lib\file_upload\KT_FileUpload.class.php

    - includes\common\lib\folder\KT_Folder.class.php

    - includes\common\lib\image\KT_Image.class.php

     

     

     

    I opened these files, but i didn't find any "function split()" occurancies.

    Are there different versions of ADDT?

    searching for "function split" will not return anything, but "split" will ;-)

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 3, 2009 1:03 PM   in reply to Günter Schenk

    Sorry, not even if i search for "split".

     

    I only find "$arr = split("[/\]", $path);" in line 2034

     

    for example in KT_Image.class.php

     

    Thats all!

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 3, 2009 1:39 PM   in reply to eagle-waa

    eagle-waa wrote:

     

    Sorry, not even if i search for "split".

     

    I only find "$arr = split("[/\]", $path);" in line 2034

     

    for example in KT_Image.class.php

     

    Thats all!

     

    that´s of course a correct result, because what happens here, is that the PHP function "split" (which is one of the native functions which are not introduced with "function") is assigned to a variable  -- nonetheless it´s something you would have to replace with this:

     

    $arr = preg_split("[\\/]", $path);

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 4, 2009 3:12 AM   in reply to Günter Schenk

    (Oh, sorry! I am not an PHP expert :-)

    Thanks al lot!

    Now i changed the files listed above.

     

    I even changed

     

    includes/tng/tNG_insert.class.php,

    tNG_update.class.php,

    tNG_delete.class.php  and

    tNG_custom.class.php

     

    replaced parent::tNG_fields($connection); with parent::tNG($connection);

     

    But still ADDT will not work with PHP 5.3

     

    Any other idea, what i could do?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 4, 2009 7:08 AM   in reply to eagle-waa

    eagle-waa wrote:

     

    I even changed

     

    includes/tng/tNG_insert.class.php,

    tNG_update.class.php,

    tNG_delete.class.php  and

    tNG_custom.class.php

     

    replaced parent::tNG_fields($connection); with parent::tNG($connection);

     

    But still ADDT will not work with PHP 5.3

    I can´t comment on this, because it´s not me who has suggested this fix. From my point of view this fix does not solve another major problem which I mentioned before in another thread: the fact that plenty of ADDT´s functions currently make use of the - now deprecated - "call-time pass-by-reference" feature (found in approx. 50 PHP files), what will of course trigger an error message when the function in question gets called by one ADDT´s components.

     

    The related warning message reads:

     

    ----------------

    Warning: call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of convert_bits_to_array(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer

    ---------------

     

    ..and PHP 6 will in fact remove this feature completely, means that modifying your php.ini might work for now and keep you from fixing this issue for each affected ADDT function, but will not solve the underlying problem on the long run.

     

    eagle-waa wrote:

     

    (Oh, sorry! I am not an PHP expert :-)

    The problem I see with all "make ADDT work with PHP 5.3." suggestions which have been contributed so far (including what I wrote, although I merely provided some clues and no real solution so far):

     

    1. it does take some sort of PHP "expert" to get all issues fixed properly

     

    2. it´s not clear whether some user who stated "this works for me" has actually tested his suggestion with each & every ADDT component

     

    Cheers,

    Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 12, 2009 12:21 PM   in reply to Brian Michel

    I am running a test server (MAMP) with PHP 5.2.11. ADDT is working properly. No extensions have broken. Email triggers and user authentication scripts all work.

     

    Must be PHP 5.3 that breaks it.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 20, 2009 10:22 PM   in reply to dloval

    Just to chime in - confirmed on this end. 5.3 is a deal breaker for ADT.

     

    The above suggestions may get you going - they did for me - but then you'll get to track down this kind of weirdness (multiple image upload).

     

    Warning: array_pop() expects parameter 1 to be array, null given in /www/xxx/html/includes/common/lib/folder/KT_Folder.class.php on line 159

    Warning: implode() [function.implode]: Invalid arguments passed in /www/xxx/html/includes/common/lib/folder/KT_Folder.class.php on line 162

     

    Writes to the db just fine and uploads the files but throwing away the validation trigger seems to solve that particular issue.

     

    Anyways... what a PITA. Seems Adobe could fix this up for 5.3 pretty easily and I still don't know why it was bought and promptly discontinued.

     

    So long ADT. It was fun doing the quicky stuff with you while it lasted. Sigh...

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 8, 2010 11:02 AM   in reply to Günter Schenk

    Hi Folks, we all knew this would come! :-(

     

    I would really love if either Adobe offered to make a patch available or one single page with all fixes available for the hundreds or even thousands who are lost in desperate space.

     

    If Adobe chooses to ignore this, I would happily contribute a small amount of euros to anyone who can offer a full /includes library that is ready for the future, at least php 5.3 to 6.0 Now if many of us contribute a small amount of euros, tons of time will be saved around the world, and someone could make a small fortune on this.

     

    What say thee!

     

    PS, Great work Güenter for all your troubleshooting and sympathy.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 8, 2010 11:05 PM   in reply to Sofus Comer

    If Adobe chooses to ignore this, I would happily contribute a small amount of euros to anyone who can offer a full /includes library that is ready for the future, at least php 5.3 to 6.0

     

    Me too!

    For this i would pay 200 $!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2010 12:51 AM   in reply to aggn62

    I was thinking of 50-100 Euros, which isnt that far from 200 USD

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 10, 2010 8:06 AM   in reply to Sofus Comer

    I gave up trying to patch ADDT.  Thank you, I mean F you, Adobe, for making us pay through the nose for a product you discontinued in less than two years and refuse to support moving forward. I have started using Data Assist by Web Assist.  http://www.webassist.com/dreamweaver-extensions/dataassist/.  I really, really liked ADDT, but this product is very good, too.  Of course, you have to buy them all as separate components.  It gets expensive, if that's what you've got to do to speed up production, then it's worth it.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 10, 2010 8:20 AM   in reply to ssailer

    I too have converted to using Web Assist. After getting through the painful learning curve, it does everything ADDT used to do. The only thing ADDT did that WA does not do is Dynamic Lists (editable data grid that you can reorder, etc). However, WA claims they are working on this and it will be coming soon. In the meantime, a fellow developer has been able to code it combining WA and a couple ajax scripts. Working through a few tutorials in the next month.

     

    WA has excellent support forums, and a great community. Monthly subscription is inexpensive and you get all the extensions.

     

    www.webassist.com

     

    D.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 10, 2010 8:24 AM   in reply to dloval

    dloval - I had already purchaed so many of the extensions that subscribing at that point would have been a waste of money for me.  But, I do agree, if you're new to WA, then subscribing may be a better option financially.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points