Re: A couple of PHP Warnings
One other Debug Log PHP warning I received this morning while inserting a new product is...
PHP Warning: Undefined variable $attributes_value in Admin/attributes_controller.php on line 1962
Would someone be able to supply to code to correct this warning??
Thanks!
Re: A couple of PHP Warnings
Quote:
Originally Posted by
NWCE
One other Debug Log PHP warning I received this morning while inserting a new product is...
PHP Warning: Undefined variable $attributes_value in Admin/attributes_controller.php on line 1962
Would someone be able to supply to code to correct this warning??
Thanks!
Has this been addressed previously? Try searching the forum for "Undefined variable $attributes_value", as suggested in the posting tips.
Re: A couple of PHP Warnings
Note, too, that when posting a log that it's important to post the full log, including the header (which identifies which page on which the issue occurred) and the backtrace (which identifies the call-chain and, in some instances, possibly the source of the issue).
Re: A couple of PHP Warnings
Thanks simon1066 for passing along the fix for this from another post. I will apply this code change from the Github link!
Re: A couple of PHP Warnings
Thanks lat9 for letting me know that in order to decipher the Debug Log that you need the entire log.
I will do this with my PHP Warnings...and also see that there is a Bug Report area....will post in there.
Thanks again
Re: A couple of PHP Warnings
Here is the full Debug Log for one the PHP Warnings (#2) I posted in previous post. Hope this helps to decipher it....and if you would share a code fix that would be great!
Request URI: /shop/index.php?main_page=checkout_process, IP address: 66.61.47.189, Language id 1
#0 /home/shop/includes/modules/payment/paypaldp.php(1645): zen_debug_error_handler()
#1/home/public_html/shop/includes/modules/payment/paypaldp.php(744): paypaldp->getLineItemDetails()
#2 /home/public_html/shop/includes/classes/payment.php(350): paypaldp->before_process()
#3 /home/public_html/shop/includes/modules/checkout_process.php(98): payment->before_process()
#4 /home/public_html/shop/includes/modules/pages/checkout_process/header_php.php(13): require('...')
#5 /home/public_html/shop/index.php(35): require('...')
--> PHP Warning: Undefined global variable $free in /home/public_html/shop/includes/modules/payment/paypaldp.php on line 1645.
[26-Mar-2025 08:45:43 America] Request URI: /shop/index.php?main_page=checkout_process, IP address: 66.61.47.189, Language id 1
#0 /home/public_html/shop/includes/modules/payment/paypaldp.php(1645): zen_debug_error_handler()
#1 /home/public_html/shop/includes/modules/payment/paypaldp.php(744): paypaldp->getLineItemDetails()
#2 /home/public_html/shop/includes/classes/payment.php(350): paypaldp->before_process()
#3 /home/public_html/shop/includes/modules/checkout_process.php(98): payment->before_process()
#4 /home/public_html/shop/includes/modules/pages/checkout_process/header_php.php(13): require('...')
#5 /home/public_html/shop/index.php(35): require('...')
--> PHP Warning: Attempt to read property "tax_class" on null in /home/public_html/shop/includes/modules/payment/paypaldp.php on line 1645.
Re: A couple of PHP Warnings
Since you didn't say, I'm assuming that you're running zc210.
Try editing /includes/modules/payment/paypaldp.php, changing line 1645 from
Code:
if (isset($GLOBALS[$module]) && $GLOBALS[$module]->tax_class > 0) {
to
Code:
if (($GLOBALS[$module]->tax_class ?? 0) > 0) {
and let me know if that corrects the issue; if so, I'll get that updated on the Zen Cart GitHub.
Re: A couple of PHP Warnings
Quote:
Originally Posted by
lat9
Since you didn't say, I'm assuming that you're running zc210.
This thread is tagged with v210
Re: A couple of PHP Warnings
Quote:
Originally Posted by
simon1066
This thread is tagged with v210
Duh! Thanks for the correction.