If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / PHP Notice: ob_flush(): Failed to flush buffer zcAjaxPayment.php

PHP Notice: ob_flush(): Failed to flush buffer zcAjaxPayment.php

Started by robertluer on 18 Jan 2024, 6:11 PM · Views: 14,117

Results 1 to 5 of 5
18 Jan 2024, 6:11 PM
#1
robertluer avatar

robertluer

New Zenner

Join Date:
Oct 2013
Location:
Canada
Posts:
30
Plugin Contributions:
0

Post #1 by robertluer

URL: canadaflagshop.com/shop
Zencart 1.5.8a
PHP 8.1.27
MySql 5.7
Host: Siteground
Plugins used - authorize.net AIM

Recently upgraded from 1.5.7d to 1.5.8a and I'm getting the following php warning in my logs folder each time a transaction is processed. The number of undefined array keys seems to correspond with the number of products on the related order. My includes/classes/ajax/zcAjaxPayment.php file is the original file with no modifications. Can anyone help?

Log info:
[17-Jan-2024 02:42:51 UTC] Request URI: /store/ajax.php?act=ajaxPayment&method=prepareConfirmation, IP address: xx.xx.xx.xx, Language id 1
#0 /home/customer/www/xxxxxx.com/public_html/store/includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php(126): zen_debug_error_handler()
#1 /home/customer/www/xxxxxx.com/public_html/store/includes/classes/ajax/zcAjaxPayment.php(191): require_once('/home/customer/...')
#2 /home/customer/www/xxxxxx.com/public_html/store/ajax.php(85): zcAjaxPayment->prepareConfirmation()
--> PHP Warning: Undefined array key 0 in /home/customer/www/xxxxxx.com/public_html/store/includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php on line 126.

[17-Jan-2024 02:42:51 UTC] Request URI: /store/ajax.php?act=ajaxPayment&method=prepareConfirmation, IP address: xx.xx.xx.xx, Language id 1
#0 /home/customer/www/xxxxxx.com/public_html/store/includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php(126): zen_debug_error_handler()
#1 /home/customer/www/xxxxxx.com/public_html/store/includes/classes/ajax/zcAjaxPayment.php(191): require_once('/home/customer/...')
#2 /home/customer/www/xxxxxx.com/public_html/store/ajax.php(85): zcAjaxPayment->prepareConfirmation()
--> PHP Warning: Undefined array key 1 in /home/customer/www/xxxxxx.com/public_html/store/includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php on line 126.

[17-Jan-2024 02:42:51 UTC] PHP Notice: ob_flush(): Failed to flush buffer. No buffer to flush in /home/customer/www/xxxxxx.com/public_html/store/includes/classes/ajax/zcAjaxPayment.php on line 193

18 Jan 2024, 7:56 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,144
Plugin Contributions:
56

Post #2 by lat9

Line 126 of /includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php currently reads:

          <?php  echo $stock_check[$i]; ?>

I *believe *that changing that line to

          <?php  echo [B](!empty([/B]$stock_check[$i][B]))  ? $stock_check[$i] : ''[/B]; ?>

will correct all those issues.

Note: Updated to align with similar coding for tpl_checkout_confirmation_default.php!

22 Jan 2024, 2:14 PM
#3
robertluer avatar

robertluer

New Zenner

Join Date:
Oct 2013
Location:
Canada
Posts:
30
Plugin Contributions:
0

Post #3 by robertluer

Thank you lat9 for the reply. I made that change and it definitely eradicated most of the warnings but I'm still getting the one liner shown below:

ob_flush(): Failed to flush buffer. No buffer to flush in /home/customer/www/xxxxxxx.com/public_html/store/includes/classes/ajax/zcAjaxPayment.php on line 193

Not sure if it's connected but I am also having a caching issue which I think is being caused by Siteground's Dynamic Cache. (I have NGINX Direct Delivery and Memcached turned off). For some reason on desktop (windows 10/chrome) I am occasionally seeing the mobile css loading but it only happens on category pages that have subcategories on them. Product ID pages load fine. As soon as I flush the dynamic cache on the siteground server the problem corrects itself but then it seems to start happening again several hours later, maybe after an order has been placed and a warning log has been generated.

Mobile template loading (on desktop chrome browser) on category page (index.php?main_page=index&cPath=1)
Attachment 20460

Page loads correctly again after flushing dynamic cache
Attachment 20459

22 Jan 2024, 3:54 PM
#4
robertluer avatar

robertluer

New Zenner

Join Date:
Oct 2013
Location:
Canada
Posts:
30
Plugin Contributions:
0

Post #4 by robertluer

Thank you lat9 for the reply. I made that change and it definitely eradicated most of the warnings but I'm still getting the one liner shown below:

ob_flush(): Failed to flush buffer. No buffer to flush in /home/customer/www/xxxxxxx.com/public_html/store/includes/classes/ajax/zcAjaxPayment.php on line 193

Likely not connected but I am also having a caching issue which I think is being caused by Siteground's Dynamic Cache. (I have NGINX Direct Delivery and Memcached turned off). For some reason on desktop (windows 10/chrome) I am occasionally seeing the mobile css loading but it only happens on category pages that have subcategories on them. Product ID pages load fine. As soon as I flush the dynamic cache the problem corrects itself but then it seems to start happening again several hours later.

Incorrectly loading mobile css on desktop pc
Attachment 20461

After flushing cache, page loads correctly again for a limited time
Attachment 20462

22 Jan 2024, 5:17 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,144
Plugin Contributions:
56

Post #5 by lat9

I *vaguely *remember issues of the type you describe with that Dynamic Cache.