Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2017
    Location
    Bulgaria
    Posts
    11
    Plugin Contributions
    0

    Default A non-numeric value ?

    Hi,
    I upgrade to 1.5.5f, but i think the error is comming after i change PHP Version to 7.1
    that is from MyDEBUG fail :

    PHP Warning: A non-numeric value encountered in /home/ga.....m/includes/classes/categories_ul_generator.php on line 58
    zen_categories_ul_generator->buildBranch() called at [/h ... ludes/classes/categories_ul_generator.php:85]
    zen_categories_ul_generator->buildTree() called at [/ho ... /includes/templates/westminster_new/templates/tpl_modules_mobile_categories_tabs.php:122]
    require(/hom... /includes/templates/westminster_new/templates/tpl_modules_mobile_categories_tabs.php) called at [/home ...emplates/westminster_new/common/tpl_header.php:121]


    line 58 from catefories_ul_generator.php is: $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
    line 85 from categories_ul_generator.php is: return $this->buildBranch($this->root_category_id, '', $submenu);
    line 122 from tpl_modules_mobile_categories_tabs is: $menulist = $zen_CategoriesUL->buildTree(true);

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: A non-numeric value ?

    Quote Originally Posted by Ang_l View Post
    Hi,
    I upgrade to 1.5.5f, but i think the error is comming after i change PHP Version to 7.1
    that is from MyDEBUG fail :

    PHP Warning: A non-numeric value encountered in /home/ga.....m/includes/classes/categories_ul_generator.php on line 58
    zen_categories_ul_generator->buildBranch() called at [/h ... ludes/classes/categories_ul_generator.php:85]
    zen_categories_ul_generator->buildTree() called at [/ho ... /includes/templates/westminster_new/templates/tpl_modules_mobile_categories_tabs.php:122]
    require(/hom... /includes/templates/westminster_new/templates/tpl_modules_mobile_categories_tabs.php) called at [/home ...emplates/westminster_new/common/tpl_header.php:121]


    line 58 from catefories_ul_generator.php is: $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
    line 85 from categories_ul_generator.php is: return $this->buildBranch($this->root_category_id, '', $submenu);
    line 122 from tpl_modules_mobile_categories_tabs is: $menulist = $zen_CategoriesUL->buildTree(true);
    This issue has been corrected for the (in-progress) Zen Cart 1.5.6 release by the following insertion into /includes/classes/categories_ul_generator.php's BuildBranch function:
    Code:
    function buildBranch($parent_id, $level = 0, $submenu=true, $parent_link='')
     {
             $level = (int)$level;
             $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
             
             if (($this->data[$parent_id])) {

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

    Default Re: A non-numeric value ?

    my experience with later versions of php7 require the casting back to a string.

    Code:
    function buildBranch($parent_id, $level = 0, $submenu=true, $parent_link='')
     {
             $level = (int)$level;
             $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. (string)($level+1) . '"' : '' );
             
             if (($this->data[$parent_id])) {
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: A non-numeric value ?

    Quote Originally Posted by carlwhat View Post
    my experience with later versions of php7 require the casting back to a string.

    Code:
    function buildBranch($parent_id, $level = 0, $submenu=true, $parent_link='')
     {
             $level = (int)$level;
             $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. (string)($level+1) . '"' : '' );
             
             if (($this->data[$parent_id])) {
    You should submit a PR, then, since the code I posted is the current version on the Zen Cart v156 GitHub.

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

    Default Re: A non-numeric value ?

    my mistake... i am not able to replicate the error using php7.1 or php7.2.
    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 2017
    Location
    Bulgaria
    Posts
    11
    Plugin Contributions
    0

    Default Re: A non-numeric value ?

    Thank you!
    After i find this
    https://www.zen-cart.com/showthread....PHP-7-warnings
    i changed categories_ul_generator.php with ...el'. (float)($level+1) . '"... that is correct? Or must change again with (string)?

    Now i changed and /includes/modules/pages/advanced_search_result/header_php.php:
    $rate = $currencies->get_value($_SESSION['currency']);
    if ($rate) {
    $pfrom = (float)$_GET['pfrom'] / $rate;
    $pto = (float)$_GET['pto'] / $rate;
    }

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

    Default Re: A non-numeric value ?

    no need to add string.

    best.

  8. #8
    Join Date
    Jan 2017
    Location
    Bulgaria
    Posts
    11
    Plugin Contributions
    0

    Default Re: A non-numeric value ?

    Thank you!

 

 

Similar Threads

  1. Replies: 38
    Last Post: 1 Nov 2018, 09:28 PM
  2. Product Listing numeric Sort Order
    By iivann in forum Basic Configuration
    Replies: 1
    Last Post: 10 Sep 2010, 03:29 PM

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