Zen Cart Logo
Forums / General Questions / error due to php 7.1.5

error due to php 7.1.5

Views: 354

Results 1 to 2 of 2
9 Oct 2018, 10:48 AM
#1
diptimoy avatar

diptimoy

Zen Follower

Join Date:
Apr 2012
Location:
Bardhaman , Bharat
Posts:
217
Plugin Contributions:
1

error due to php 7.1.5

[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

How to solve this

[09-Oct-2018 12:43:18 Europe/Berlin] PHP Warning: A non-numeric value encountered in ../includes/classes/categories_ul_generator.php on line 58

line 58 is this code

$result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );

on printing $this->parent_group_start_string echos blank

In another server where php is 5.6 , doesn't generate the error

9 Oct 2018, 11:07 AM
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: error due to php 7.1.5

Add "$level = (int)$level;" so it look like this,

        $level = (int)$level;
        $result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );

or use the "/includes/classes/categories_ul_generator.php" file from the Zen Cart 1.5.6 repo on github