Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    29
    Plugin Contributions
    0

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

    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

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

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

    Line 126 of /includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php currently reads:
    Code:
              <?php  echo $stock_check[$i]; ?>
    I believe that changing that line to
    Code:
              <?php  echo (!empty($stock_check[$i]))  ? $stock_check[$i] : ''; ?>
    will correct all those issues.

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

  3. #3
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    29
    Plugin Contributions
    0

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

    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)
    Click image for larger version. 

Name:	loading mobile.jpg 
Views:	9 
Size:	39.5 KB 
ID:	20460

    Page loads correctly again after flushing dynamic cache
    Click image for larger version. 

Name:	after cache flush.jpg 
Views:	14 
Size:	41.3 KB 
ID:	20459

  4. #4
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    29
    Plugin Contributions
    0

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

    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
    Click image for larger version. 

Name:	loading mobile on desktop pc.jpg 
Views:	16 
Size:	39.5 KB 
ID:	20461

    After flushing cache, page loads correctly again for a limited time
    Click image for larger version. 

Name:	after cache flush.jpg 
Views:	16 
Size:	41.3 KB 
ID:	20462

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

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

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

 

 

Similar Threads

  1. Replies: 7
    Last Post: 28 Sep 2021, 11:56 PM
  2. Replies: 4
    Last Post: 24 Oct 2020, 09:04 AM
  3. v157 PHP Notice: Undefined index
    By yueli7 in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 24 Jul 2020, 06:56 PM
  4. Replies: 4
    Last Post: 17 Jul 2015, 04:44 AM
  5. PHP Warning "failed to open stream" on admin/index.php
    By tundrasnake in forum Installing on a Windows Server
    Replies: 4
    Last Post: 19 May 2009, 02:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR