Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Plugin Contributions

    Default PHP Warning: A non-numeric value encountered in categories_ul_generator.php line 73

    [Note: ZC version 1.5.5.f, , PHP version 7.2, etc ]
    I think you have fixed this bug in 1.5.6. But was reading the php manual as I think the warning occoured as a result of moving from 7.0 to 7.2. Have same issue in 7.1.
    In 1.5.6 you have inserted
    PHP Code:
    $level = (int)$level
    in \includes\classes\categories_ul_generator.php line 58 to change the '' string that you have to 0 (zero) the manual suggest that casting a string to integer if fine if it contains numbers however it suggest the any other behaviour could change without warning. Could i suggest that perhaps you should consider changing the call in the same module line 86 from
    PHP Code:
     function buildTree($submenu=false)
    PHP Code:
     function buildTree($submenu=false)
    this appears to solve the issue.
    Last edited by brittainmark; 12 Dec 2018 at 04:48 PM. Reason: additiona information
    Mark Brittain

  2. #2
    Join Date
    Jan 2004
    Blog Entries
    Plugin Contributions

    Default Re: PHP Warning: A non-numeric value encountered in categories_ul_generator.php line


    The "$level = (int)$level;" fix is sufficient for all known PHP versions.

    Your suggestion of switching to NULL is noted (and good), however in doing that I'd make a few more changes. We will consider that for a future update. In the meantime, the v156 code contains a suitable fix.

    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: 2
    Last Post: 18 Nov 2018, 04:06 AM
  2. Replies: 38
    Last Post: 1 Nov 2018, 09:28 PM
  3. Replies: 0
    Last Post: 18 Feb 2018, 06:26 PM
  4. Replies: 20
    Last Post: 7 Dec 2014, 11:29 AM
  5. Replies: 0
    Last Post: 27 Sep 2012, 11:57 PM


Posting Permissions

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