Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    bug shipping modules and PHP 7.2

    I originally thought this was a template related issue, unable to track it down.

    I completed a vanilla install, went through checkout process, no debug files generated.

    Installed ups_v2019_01_08

    upon clicking modules > shipping

    the following was created
    Code:
    [13-Jan-2019 18:13:29 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/***/modules.php?set=shipping, IP address: ***
    #1 ups->__construct() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/***/modules.php:195]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_SORT_ORDER - assumed 'MODULE_SHIPPING_UPS_SORT_ORDER' (this will throw an Error in a future version of PHP) in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping/ups.php on line 61.
    
    [13-Jan-2019 18:13:29 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/***/modules.php?set=shipping, IP address: ***
    #1 ups->__construct() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/***/modules.php:195]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_TAX_CLASS - assumed 'MODULE_SHIPPING_UPS_TAX_CLASS' (this will throw an Error in a future version of PHP) in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping/ups.php on line 63.
    
    [13-Jan-2019 18:13:29 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/***l/modules.php?set=shipping, IP address: ***
    #1 ups->__construct() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/***/modules.php:195]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_TAX_BASIS - assumed 'MODULE_SHIPPING_UPS_TAX_BASIS' (this will throw an Error in a future version of PHP) in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping/ups.php on line 64.
    
    [13-Jan-2019 18:13:29 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/***/modules.php?set=shipping, IP address: ***
    #1 ups->__construct() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/***/modules.php:195]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_STATUS - assumed 'MODULE_SHIPPING_UPS_STATUS' (this will throw an Error in a future version of PHP) in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping/ups.php on line 68.
    
    [13-Jan-2019 18:13:29 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/***/modules.php?set=shipping, IP address: ***
    #1 ups->__construct() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/***/modules.php:195]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPS_STATUS - assumed 'MODULE_SHIPPING_UPS_STATUS' (this will throw an Error in a future version of PHP) in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping/ups.php on line 72.
    For the catalog side while using the shipping estimator, the following was created:
    Code:
    [13-Jan-2019 18:45:31 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/index.php?main_page=popup_shipping_estimator, IP address: ***
    #1 sizeof() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/classes/shipping.php:186]
    #2 shipping->cheapest() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping_estimator.php:210]
    #3 require(/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping_estimator.php) called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php:16]
    #4 require(/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php) called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/classes/shipping.php on line 186.
    
    [13-Jan-2019 18:45:31 America/New_York] Request URI: /zca_templates/zca_tpl_demo_6/index.php?main_page=popup_shipping_estimator, IP address: 71.176.114.218
    #1 sizeof() called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/templates/tpl_modules_shipping_estimator.php:134]
    #2 require(/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/templates/tpl_modules_shipping_estimator.php) called at [/home/zcaddit1/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping_estimator.php:256]
    #3 require(/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/modules/shipping_estimator.php) called at [/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php:16]
    #4 require(/home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php) called at [/home/zcaddit1/public_html/zca_templates/zca_tpl_demo_6/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/***/public_html/zca_templates/zca_tpl_demo_6/includes/templates/template_default/templates/tpl_modules_shipping_estimator.php on line 134.
    The same using fedex_web_services_1_7_6 by numinix

    I spent hours thinking this was a template issue/bug
    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1.5.6a shipping modules

    Moving this out of the Bug Reports area, since it's related to addons, and is caused by PHP 7.2 issues, not by new code in Zen Cart v1.5.6
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: shipping modules and PHP 7.2

    That said, I've posted an update to the UPS module, for improved PHP 7.2 compatibility.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: shipping modules and PHP 7.2

    USPS causes similar DEBUG.

    Code:
    [13-Jan-2019 17:56:28 America/Los_Angeles] Request URI: /156/index.php?main_page=popup_shipping_estimator, IP address: 98.146.xxx.yyy#1  sizeof() called at [/home/cPanel/public_html/156/includes/classes/shipping.php:186]
    #2  shipping->cheapest() called at [/home/cPanel/public_html/156/includes/modules/shipping_estimator.php:210]
    #3  require(/home/cPanel/public_html/156/includes/modules/shipping_estimator.php) called at [/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php:16]
    #4  require(/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php) called at [/home/cPanel/public_html/156/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/cPanel/public_html/156/includes/classes/shipping.php on line 186.
    
    
    [13-Jan-2019 17:56:28 America/Los_Angeles] Request URI: /156/index.php?main_page=popup_shipping_estimator, IP address: 98.146.xxx.yyy
    #1  sizeof() called at [/home/cPanel/public_html/156/includes/templates/bootstrap/templates/tpl_modules_shipping_estimator.php:153]
    #2  require(/home/cPanel/public_html/156/includes/templates/bootstrap/templates/tpl_modules_shipping_estimator.php) called at [/home/cPanel/public_html/156/includes/modules/shipping_estimator.php:256]
    #3  require(/home/cPanel/public_html/156/includes/modules/shipping_estimator.php) called at [/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php:16]
    #4  require(/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php) called at [/home/cPanel/public_html/156/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/cPanel/public_html/156/includes/templates/bootstrap/templates/tpl_modules_shipping_estimator.php on line 153.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,669
    Plugin Contributions
    9

    Default Re: shipping modules and PHP 7.2

    Quote Originally Posted by RixStix View Post
    USPS causes similar DEBUG.

    Code:
    [13-Jan-2019 17:56:28 America/Los_Angeles] Request URI: /156/index.php?main_page=popup_shipping_estimator, IP address: 98.146.xxx.yyy#1  sizeof() called at [/home/cPanel/public_html/156/includes/classes/shipping.php:186]
    #2  shipping->cheapest() called at [/home/cPanel/public_html/156/includes/modules/shipping_estimator.php:210]
    #3  require(/home/cPanel/public_html/156/includes/modules/shipping_estimator.php) called at [/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php:16]
    #4  require(/home/cPanel/public_html/156/includes/templates/template_default/popup_shipping_estimator/tpl_main_page.php) called at [/home/cPanel/public_html/156/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/cPanel/public_html/156/includes/classes/shipping.php on line 186.
    i resolved the above error by adding the following code into:

    /includes/classes/shipping.php

    at line 186...

    PHP Code:
              $quotes $GLOBALS[$class]->quotes;
    //new code
              
    if (!is_array($quotes['methods'])) {
                  return;
              }
    //end new code
              
    $size sizeof($quotes['methods']); 
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: shipping modules and PHP 7.2

    Quote Originally Posted by carlwhat View Post
    i resolved the above error by adding the following code into:

    /includes/classes/shipping.php

    at line 186...

    PHP Code:
              $quotes $GLOBALS[$class]->quotes;
    //new code
              
    if (!is_array($quotes['methods'])) {
                  return;
              }
    //end new code
              
    $size sizeof($quotes['methods']); 
    Given that many modules seem to send back empty responses, we should probably patch for that. Feel free to PR. Although I prefer if (empty()) as opposed to if (!is_array()) in this case (... unless you've found a reason to expect a valid string or integer response).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 9 Aug 2012, 04:42 PM
  2. Replies: 4
    Last Post: 23 Feb 2010, 11:35 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