X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   X-Payments issues & questions (https://forum.x-cart.com/forumdisplay.php?f=50)
-   -   X-Payments Fatal error: Access to undeclared static property: (https://forum.x-cart.com/showthread.php?t=68276)

Duramax 6.6L 12-06-2013 04:52 PM

X-Payments Fatal error: Access to undeclared static property:
 
I installed xpayments V2.0.0 and set every thing up. Logged into the admin back end and when I go to settings/payment configurations I am getting the following error.

Fatal error: Access to undeclared static property: XPay_Model_Base_Module::$this in /homPPduramax/public_html/xxxxxxxxxxx/lib/XPay/Model/Base/Module.php on line 153

Any Idea on how to fix, Submitted ticket to X-Cart, waiting for reply.

cjstancil 12-08-2013 06:14 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
I've got the same error message today (and have had customer orders FAIL for the past 2 days). In my case a different line number (131) in the same module.

What's going on here?! I've made NO changes to any configurations or files in our store in the past week!

Running X-Cart 4.5.5 and X-Payments 1.0.6.

ambal 12-09-2013 12:58 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
It is due to updating PHP to v 5.4.

To fix the problem, in lines 131 and 153 of

<xpayments_dir>/lib/XPay/Model/Base/Module.php

change

PHP Code:

self::$this-> 


to

PHP Code:

$this-> 


Please let me know if this helps.

mafriends 12-09-2013 03:20 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
I was getting these errors too. This fixed the problem, but it looks like there are more issues.

Getting this error message when trying to lock or unlock an account. Also getting it when trying to generate new keys on this page: admin.php?target=encrypt_keys
Internal error
The requested action cannot be performed. See logs for details.
Is there anything else that needs to be changed?

ambal 12-09-2013 03:29 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
> See logs for details.

And what the logs say?
See http://help.x-cart.com/index.php?title=X-Payments:FAQ#Where_can_I_find_X-Payments_logs.3F

mafriends 12-09-2013 04:30 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
This is the error:

Failed to perform SMTP command: ("503") "AUTH command used when not advertised"
Affected systems: Core/SMTP.php file (403:assert); Core/SMTP.php file (347:doCommand); Core/SMTP.php file (419:sendCommand); Core/SMTP.php file (483:sendLoginAuth); Core/SMTP.php file (625:doAuth); Core/Mailer.php file (282:openMail); Core/Mailer.php file (258:prepareQueue); Core/Dispatcher.php file (152:send); Application.php file (156:dispatch); /home/xxxxxxxx/public_html/xpay/admin.php file (26:run)

ambal 12-09-2013 04:32 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
As you can see your issue does not relate to the original one reported here. For some reason your X-Payments v1 cannot connect to SMTP server to send notifications. I suggest you to contact our techs using your HelpDesk account at https://secure.x-cart.com to figure our what's wrong with SMTP server connection on your X-Payments server.

cjstancil 12-09-2013 09:22 PM

Re: X-Payments Fatal error: Access to undeclared static property:
 
My web host decided to just revert us back to PHP 5.3. Will this change that you recommend still work for PHP 5.3? If so then I'll make the change and not have to worry about my web host changing back to PHP 5.4 in the future!

ambal 12-10-2013 01:13 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Quote:

Originally Posted by cjstancil
My web host decided to just revert us back to PHP 5.3. Will this change that you recommend still work for PHP 5.3? If so then I'll make the change and not have to worry about my web host changing back to PHP 5.4 in the future!


It should work with PHP 5.3

carpeperdiem 12-10-2013 07:33 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
I had the exact issue today -- and THANK YOU, Alex for sending me a fast PM reply.

Chuck, my host (Hands-on) also suggested we revert to php 5.3 for now.

Alex, when you feel better, can you share any other known issues with php 5.4.x and x-payments 1.0.6 ?

Thanks,

Jeremy

ambal 12-10-2013 07:37 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
> can you share any other known issues with php 5.4.x and x-payments 1.0.6 ?

This is the only one we believe. Generally speaking this is a sort of typo in our code that all PHP versions before 5.4 allowed and thus we didn't stumble upon it during our tests before PHP v5.4 was rolled out.

carpeperdiem 12-10-2013 09:12 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Quote:

Originally Posted by ambal
> can you share any other known issues with php 5.4.x and x-payments 1.0.6 ?

This is the only one we believe. Generally speaking this is a sort of typo in our code that all PHP versions before 5.4 allowed and thus we didn't stumble upon it during our tests before PHP v5.4 was rolled out.


Alex,

I know there are many moving parts, and 1.0.x has been replaced by younger, thinner, and better looking, but I would imagine that there are still more than a handful of stores running xp 1.0.x --- and for something as mission critical as a typo that will kill x-payments if server is upgraded to 5.4.x, wouldn't it have been better to email a hotfix to all current owners of 1.0.x ?

I know this is not X-Cart's way -- but maybe it should be?

IF you discover a defect, why not publish it?

Before I permitted my server manager to upgrade to php 5.4, I looked at system requirements and I looked at all release notes for x-p 1.0.6 -- and there were no published mentions of this very easy to fix but mission-critical defect.

WHY not add this to the system requirements? Or better yet, email a hotfix to all -- because this fix is benign in php 5.3, there is no reason for all 5.3 owners to not just do it. They will have to do it when their server goes to 5.4 (at the latest in mid-2014).

I know hotfixes are not part of the X-Cart way, but maybe you should think about publishing a list of these? It would reduce the number of 911 calls you get. And you would have a cover-your-ass link, "did you apply all the published hotfixes before you broke your cart?"

How many servers will be upgrading from php 5.3 to 5.4 -- I bet many in the coming months... so IF YOU KNOW that something is broken in X-Payments 1.x, why not share this with everyone?

Just saying.
I hope you feel better soon.

Jeremy

carpeperdiem 12-10-2013 06:40 PM

Re: X-Payments Fatal error: Access to undeclared static property:
 
PS -- x-payments 1.0.6 (patched as per post #3) has now been running all day with php 5.4.x -- working just fine. Trying to stuff keywords that others may use to find this thread in the future.

ambal 12-10-2013 11:30 PM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Jeremy, thank you for your good wishes. I am getting better day after day.

And yes, of course the newsletter is on the way to all owners of X-Payments licenses.

Those who are on Hosted X-Payments plans do not need to worry as the patch has been applied by our data center staff.

carpeperdiem 12-11-2013 07:20 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Dear Alex and Team X-Cart,

I just received an email with the hotfix notice.

Now THAT'S how you do it!!! :-)

Considering php 5.3.x will be EOL by mid-year 2014, this is going to be an issue for many. You just covered your ass and helped many store admins, all at the same time.

I would love to see future hotfixes for minor and major bugs in a database as well as email.

Thanks for being proactive on this!

Best,

Jeremy

gblair 12-11-2013 07:25 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
I've been running on PHP5.4 for over a month without any problems.
Running 4.1.10 and xpayments 1.0.4

So the fact I'm not having any issues is strangely worrying.
Should this issue affect everyone running PHP5.4? in which case something is wrong, since my host says I'm set to PHP5.4.

Should I run the patch anyway? Or leave well alone since it seems quite happy?

carpeperdiem 12-11-2013 07:28 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Quote:

Originally Posted by gblair
I've been running on PHP5.4 for over a month without any problems.
Running 4.1.10 and xpayments 1.0.4


This may be only for x-payments 1.0.6 and 2.0x ?

Look at the file:
<xpayments_dir>/lib/XPay/Model/Base/Module.php

lines 131 and 153

if you see

self::$this->

then you need to patch.

Yes?

Mokee 12-11-2013 07:32 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Same here gblair, been running xc 4.6.1 and xp 1.0.6 on PHP 5.4 for a long while with no issues for months. I'm leaving it alone - when it ain't broke, don't fix it! :)

Mokee 12-11-2013 07:39 AM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Quote:

Originally Posted by carpeperdiem
This may be only for x-payments 1.0.6 and 2.0x ?

Look at the file:
<xpayments_dir>/lib/XPay/Model/Base/Module.php

lines 131 and 153

if you see

self::$this->

then you need to patch.

Yes?


Hrm, no patch applied here but mine was already without 'self' scope operator. Was this an issue that had been addressed previously somewhere? I don't remember fixing this myself when the server was upgraded to 5.4 months ago.

vtandon 12-18-2013 04:02 PM

Re: X-Payments Fatal error: Access to undeclared static property:
 
Thank you guys.
you are a life saver!


All times are GMT -8. The time now is 11:34 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.