Zen Cart Logo
Forums / General Questions / V150 - PHP 5.4 issue - Edit Order Button Not Working

V150 - PHP 5.4 issue - Edit Order Button Not Working

Views: 3,890

Results 1 to 9 of 9
5 Feb 2016, 7:41 PM
#1
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

V150 - PHP 5.4 issue - Edit Order Button Not Working

My client is running V150 on PHP 5.4. We just moved to a server that's using PHP 5.4, i'm assuming the last server was using a different PHP version and that's why this error didn't come up.

If you click on the Edit button to edit a customers order we're gettting:

PHP Warning: Creating default object from empty value in C:\Inetpub\vhosts\xxxx.com\xxxx.com\store\includes\modules\payment\authorizenet_aim.php on line 439

The lines of code in that area are:

 function admin_notification($zf_order_id) {
    global $db;
    $output = '';
    $aimdata->fields = array();
    require(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/authorizenet/authorizenet_admin_notification.php');
    return $output;
  }

Again, we're on PHP 5.4 and a Windows Server.

Is there a workaround that I can imply for a temp fix in the time being until I get them to upgrade?

Thanks in advance,

Chad

5 Feb 2016, 8:02 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

inklingsolutions:

My client is running V150 on PHP 5.4. We just moved to a server that's using PHP 5.4, i'm assuming the last server was using a different PHP version and that's why this error didn't come up.

If you click on the Edit button to edit a customers order we're gettting:

PHP Warning: Creating default object from empty value in C:\Inetpub\vhosts\xxxx.com\xxxx.com\store\includes\modules\payment\authorizenet_aim.php on line 439

The lines of code in that area are:

function admin_notification($zf_order_id) {
global $db;
$output = '';
$aimdata->fields = array();
require(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/authorizenet/authorizenet_admin_notification.php');
return $output;
}

> 
> Again, we're on PHP 5.4 and a Windows Server.
> 
> Is there a workaround that I can imply for a temp fix in the time being until I get them to upgrade?
> 
> Thanks in advance,
> 
> Chad


 Looking at the equivalent code for ZC 1.5.4, revise the code to:

function admin_notification($zf_order_id) {
global $db;
$output = '';
$aimdata = new stdClass;
$aimdata->fields = array();
require(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/authorizenet/authorizenet_admin_notification.php');
return $output;
}


But there may also be other changes necessary, ie. might just need to incorporate all of the authorizenet associated files from ZC 1.5.4 or at least at some point after ZC 1.5.1...
6 Feb 2016, 2:21 PM
#3
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

MC,

A few things. One the cache folder didn't have the correct permissions to let it be able to log the error on the new server, so that's why it wasn't allowing the Edit button to work in the admin and it was displaying the error in the admin instead. I changed the permissions on the folder and now your able to get into the users order via Edit button. That didn't solve the actual issue though.

So, I applied your fix, which got me past that error on line 439 but then I got and error on /includes/modules/payment/authorizenet/authorizenet_admin_notification.php file on line 21. This file for V150, is the same as V154 file when I compared the two.

// strip slashes in case they were added to handle apostrophes:
  foreach ($aimdata->fields as $key=>$value){
    $aimdata->fields[$key] = stripslashes($value);
  }

I tried using the V154 and V153 /includes/modules/payment/authorizenet_aim.php file to see if they would work by some chance. It solved the issue in admin, i wasn't getting any errors but I would get a communication error when the credit card was processed.

Now with using the V150 file set for authorize.net, the credit cards will process fine but we obviously get the error.
PHP Warning: Creating default object from empty value in C:\Inetpub\vhosts\xxxx.com\xxxxx.com\store\includes\modules\payment\authorizenet_aim.php on line 439

Any other other suggestions to try?

Thanks for advice,

Chad

6 Feb 2016, 3:14 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

In one of your last paragraphs, you refer to using the authorize.net "fileset", but above only reference two files, authorizenet_aim and the one file in the authorizenet subdirectory. Yes the file in the subdirectory is from back in 2011 even in ZC 1.5.4 which is in line with early ZC 1.5.x. The authorizenet_aim.php file has been changed since ZC 1.5.0, but so as also the authorizenet.php file. So as I mentioned above that may need to incorporate all of the authorizenet fles. There are also some in the languages directory that I don't know if might be applicable as well. Would hope that they wouldn't affect operation, but...

As to the error in /includes/modules/payment/authorizenet/authorizenet_admin_notification.php

What was the error?

Also, I have seen some posts related to a similar issue that have identified that possibly ZC 1.5.2 files might be an acceptable middle ground. Those files can be found at: https://github.com/zencart/zencart/tree/v152/includes/modules/payment

I'm a smidge limited on what I can do at the moment, not having a lot of (almost none) tools to "easily" identify differences.

6 Feb 2016, 3:41 PM
#6
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

MC,

Sorry on forgetting to include that error, here it is:

[06-Feb-2016 15:34:02 UTC] PHP Warning: Invalid argument supplied for foreach() in C:\Inetpub\vhosts\xxxxx.com\xxxxx.com\store\includes\modules\payment\authorizenet\authorizenet_admin_notification.php on line 21

which that line was:

// strip slashes in case they were added to handle apostrophes:
  foreach ($aimdata->fields as $key=>$value){
    $aimdata->fields[$key] = stripslashes($value);
  }  

As for the file set, yea I was just referring to those two authorize.net files. So, I take it there are a few other files that I need to change also if I wanted to see if the V154 authorize.net files actually work. Maybe that's why I got the communications error when I just updated those two files from the V154 version and the rest.

Again, sorry for taking this back to V150, it's the oldest version i'm dealing with, with this client. Everyone of my other clients are on V154.

Thanks again for the time and patience,

Chad

6 Feb 2016, 3:43 PM
#7
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

Kobra,

I agree 100% on upgrading. All my other clients have upgraded and I plan on having this client upgrade soon but some times it takes a minute to get them to move with a modified store and the time to up grade money wise for them.

But I 100% agree...Just looking for the band aid until they give me the ok to move on the upgrade.

Chad

6 Feb 2016, 7:26 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

Well, I looked at the history for the. Includes/modules/payment directory targeting authorize.net related files. There was some change recently and applicable to 1.5.4 that changed the communication information and added some things to what is/was sent to authorize.net... It could be that data that was causing the comm error. But, the above foreach issue, is likely something else. I'll see if I can spot anything and try to get back on it if resolution isn't had otherwise. It is something related to the assignment of the variable at an earlier stage when a query was made/assigned.

8 Feb 2016, 4:26 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: V150 - PHP 5.4 issue - Edit Order Button Not Working

I'm pretty sure you should be able to use the v154 version of the authorizenet_aim.php module on v150.