ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
The code:Code:[13-Jan-2018 18:24:07 Europe/Lisbon] PHP Warning: A non-numeric value encountered in /home/xxxxxx/public_html/includes/modules/pages/advanced_search_result/header_php.php on line 370
I did check on git to see if there were updates on this , but I see no changes.PHP Code:
$rate = $currencies->get_value($_SESSION['currency']);
if ($rate) {
$pfrom = $_GET['pfrom'] / $rate;
$pto = $_GET['pto'] / $rate;
}
Should I use a float($rate) ?
Thanks
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Nope, the issue there is that the pfrom/pto values, if not set in the form, come back as '' (a non-numeric value). Try the following instead:
PHP Code:
$rate = $currencies->get_value($_SESSION['currency']);
if ($rate) {
$pfrom = ((float)$_GET['pfrom']) / $rate;
$pto = ((float)$_GET['pto']) / $rate;
}
Thanks, I'll try that
Last edited by swguy; 27 May 2018 at 10:18 PM.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
....in classes/currencies.php, to clarify.I added
if (!is_numeric($number)) $number = 0;
at line 46.
Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...
Seen this a couple of times:
[29-May-2018 07:16:10 America/Los_Angeles] PHP Warning: Creating default object from empty value in admin/product.php on line 224
Fix is pretty straightforward - above line 224 in admin/product.php add
if (!is_object($pInfo)) $pInfo = new StdClass();
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
I am having the same error
PHP Warning: A non-numeric value encountered in ..../public_html/includes/classes/categories_ul_generator.php on line 73
Line 73 is
$result .= $this->buildBranch($category_id, $level+1, $submenu, $category_link . '_');
Coming from the block code
if (($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $submenu, $category_link . '_');
}
$result .= $this->child_end_string;
What is the fix for this error?
zen cart 1.5.5f
Last edited by TamyA; 20 Jul 2018 at 10:41 PM. Reason: More detailes
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Sorry, more than likely will need to add the above at or around line 58 so that $level will be forced to be an integer. In newer php versions it is/will be possible to cast/expect the value to be an integer, but to maintain the existing backwards compatibility the above was the way chosen.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks