cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 57 forks source link

PPCP - Under PHP 8.1 throws thousands of warnings #3052

Closed havenswift-hosting closed 2 years ago

havenswift-hosting commented 2 years ago

The changes needed for core for 8.1 are likely going to be needed for all plugins - for example PayPal Commerce under 8.1 throws huge numbers of notices, warnings etc into the PHP error_log

bhsmither commented 2 years ago

Any sense of how many are not 'Undefined variable' and 'Undefined array key' for PayPal Commerce?

havenswift-hosting commented 2 years ago

Nope - deleted the 9MB with several hundred thousands lines added to the error_log file created in a few hours and downgraded client back to 7.4

claudia39 commented 2 years ago

I saved a compressed file of the error log when it was at about 24000 lines. Do you want me to email it to you Brian? Also sinceI've been put back to PHP 7.4 I've gotten a few PayPal warnings. Should I send you those too? Claudia

bhsmither commented 2 years ago

If the error_log relates to the PayPal module (or any other module), then yes. Otherwise, because I have been working through the core code with PHP8.1, I won't find much that I haven't already reported.

So, yes, email it to me.

claudia39 commented 2 years ago

And here are the errors I got today [30-Aug-2022 03:32:10 America/Louisville] PHP Warning: Undefined global variable $cart in /home/claudias/public_html/modules/plugins/paypal_commerce/paypal.class.php on line 435 [30-Aug-2022 03:32:10 America/Louisville] PHP Warning: Attempt to read property "basket" on null in /home/claudias/public_html/modules/plugins/paypal_commerce/paypal.class.php on line 435 [30-Aug-2022 03:32:10 America/Louisville] PHP Warning: Trying to access array offset on value of type null in /home/claudias/public_html/modules/plugins/paypal_commerce/paypal.class.php on line 435 [30-Aug-2022 03:32:10 America/Louisville] PHP Warning: Undefined variable $disable_funding in /home/claudias/public_html/modules/plugins/paypal_commerce/paypal.class.php on line 697 [30-Aug-2022 06:24:53 America/Louisville] PHP Warning: Invalid Security Token in /home/claudias/public_html/classes/sanitize.class.php on line 155

From: Brian Smither @.> Sent: Tuesday, August 30, 2022 1:40 PM To: cubecart/v6 @.> Cc: claudia39 @.>; Comment @.> Subject: Re: [cubecart/v6] PayPal Commerce under PHP 8.1 throws thousands of warnings (Issue #3052)

If the error_log relates to the PayPal module (or any other module), then yes. Otherwise, because I have been working through the core code with PHP8.1, I won't find much that I haven't already reported. So, yes, email it to me. — Reply to this email directly, view it on GitHub https://github.com/cubecart/v6/issues/3052#issuecomment-1231968883 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHR72YBT3V444EOKAY4BNTV3ZBO5ANCNFSM6AAAAAAQADWZMA . You are receiving this because you commented. https://github.com/notifications/beacon/ADHR724FIXFH2ICKXADELDTV3ZBO5A5CNFSM6AAAAAAQADWZMCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSJNZNHG.gif Message ID: @. @.> >

claudia39 commented 2 years ago

Did you get the attachment?

bhsmither commented 2 years ago

Nothing sent directly to me from you.

bhsmither commented 2 years ago

I haven't found anything that screams "Fix me now!" that hasn't already been made an issue.

A lot of log entries (again, these errors are not important) can be quieted with this: https://github.com/smarty-php/smarty/issues/789

abrookbanks commented 2 years ago

Yes it needs an update but from my testing works fine on PHP 8.1. I'll get around to this asap.

abrookbanks commented 2 years ago

Hi @bhsmither

Are you working on this one? I don't want to step on your toes if so. Let me know if not and I'll jump on this. Happy to take this on if you want to share findings so far?

bhsmither commented 2 years ago

I am not.

abrookbanks commented 2 years ago

Ok thanks. I'm not sure how I got the impression you were.

On Thu, 8 Sept 2022, 16:26 Brian Smither, @.***> wrote:

I am not.

— Reply to this email directly, view it on GitHub https://github.com/cubecart/v6/issues/3052#issuecomment-1240872791, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCPWY3IVNQ5ECYJ6RLEU7LV5IAQXANCNFSM6AAAAAAQADWZMA . You are receiving this because you commented.Message ID: @.***>

bhsmither commented 2 years ago

These are the errors that were logged in an error report sent to me that relate to PPCP:

Undefined global variable $cart in /paypal_commerce/paypal.class.php on line 435
Attempt to read property "basket" on null in /paypal_commerce/paypal.class.php on line 435
Trying to access array offset on value of type null in /paypal_commerce/paypal.class.php on line 435
Attempt to read property "server_response_code" on string in /plugins/paypal_commerce/paypal.class.php on line 972
Undefined variable $disable_funding in /paypal_commerce/paypal.class.php on line 697
Undefined variable $placement in /paypal_commerce/hooks/class.gui.head_js.php on line 57
Undefined global variable $_GET in /paypal_commerce/hooks/class.gui.head_js.php on line 13
Trying to access array offset on value of type null in /paypal_commerce/hooks/class.gui.head_js.php on line 13
Undefined global variable $_GET in /paypal_commerce/hooks/class.gui.head_js.php on line 33
Trying to access array offset on value of type null in /paypal_commerce/hooks/class.gui.head_js.php on line 33
Undefined global variable $_GET in /paypal_commerce/hooks/class.gui.head_js.php on line 86
Trying to access array offset on value of type null in /paypal_commerce/hooks/class.gui.head_js.php on line 86
Undefined array key "digital_only" in /paypal_commerce/paypal.class.php on line 1099
Undefined array key "delivery_address" in /paypal_commerce/paypal.class.php on line 1102
Trying to access array offset on value of type null in /paypal_commerce/paypal.class.php on line 1102
Undefined array key "billing_address" in /paypal_commerce/paypal.class.php on line 1110
Trying to access array offset on value of type null in /paypal_commerce/paypal.class.php on line 1110
Undefined array key "shipping" in /paypal_commerce/paypal.class.php on line 1082
Trying to access array offset on value of type null in /paypal_commerce/paypal.class.php on line 1082
abrookbanks commented 2 years ago

Thanks.

On Thu, 8 Sept 2022, 18:54 Brian Smither, @.***> wrote:

These are the errors that were logged in an error report sent to me that relate to PPCP:

Undefined global variable $cart in /paypal_commerce/paypal.class.php on line 435 Attempt to read property "basket" on null in /paypal_commerce/paypal.class.php on line 435 Trying to access array offset on value of type null in /paypal_commerce/paypal.class.php on line 435 Attempt to read property "server_response_code" on string in /plugins/paypal_commerce/paypal.class.php on line 972

— Reply to this email directly, view it on GitHub https://github.com/cubecart/v6/issues/3052#issuecomment-1241045679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCPWYZAQQ5IP5P3LWDEN7TV5IR5BANCNFSM6AAAAAAQADWZMA . You are receiving this because you commented.Message ID: @.***>

abrookbanks commented 2 years ago

Your version of PayPal Commerce must be out of date as I can't match up most of these errors.

havenswift-hosting commented 2 years ago

It was running the latest version at the time

abrookbanks commented 2 years ago

1.7.2 released which should catch most if not all. If you do find more let me know.