Hi,
I have OC3.0.3.1 and I got these errors, I searched online with no luck. Can someone please help?
PHP Notice: A non well formed numeric value encountered in:
/catalog/controller/product/category.php on line 342, 332, 157
/system/library/pagination.php on line 57, 54, 94
/catalog/controller/product/search.php on line 408, 185
storage/modification/catalog/controller/product/product.php on line 833, 812
PHP Notice: Trying to access array offset on value of type bool in /catalog/controller/product/special.php on line 84, 91, 96, 109, 115, 117, 118, 122, 123, 124
This error could be caused by the usage of PHP 8 which isn't supported by OC 3.0.3.1. Use PHP 7.4 or 7.3.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Thanks "ADD Creative", I followed your link and it was quite difficult to understand the page, however, after clicking the "files changed" tab, it took me to https://github.com/opencart/opencart/pull/8688/files, and I changed all those files and still getting the same error.ADD Creative wrote: ↑Thu Mar 23, 2023 4:14 amThe following may help.
https://github.com/opencart/opencart/pull/8688
viewtopic.php?t=229934
Ok, I think I got it now,
So I need to edit all the following files:
/catalog/controller/product/category.php manufacturer.php product.php search.php special.php
and change
}
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
} else {
$page = 1;
}
to
}
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
Basically, adding (int) to make the $page integer. Does that cause issue if the number goes negative?
Also what about these files?
/system/library/pagination.php
storage/modification/catalog/controller/product/product.php
So I need to edit all the following files:
/catalog/controller/product/category.php manufacturer.php product.php search.php special.php
and change
}
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
} else {
$page = 1;
}
to
}
if (isset($this->request->get['page'])) {
$page = (int)$this->request->get['page'];
} else {
$page = 1;
}
Basically, adding (int) to make the $page integer. Does that cause issue if the number goes negative?
Also what about these files?
/system/library/pagination.php
storage/modification/catalog/controller/product/product.php
Yes, you just have to add (int) in front of $this->request->get['page'] for all those files.
Negative number shouldn't matter as the warnings are caused by bots setting the page to non-numeric values.
system/library/pagination.php won't be an issue if the (int) in added in the other files.
Once you have made the changes, refresh your modifications. This will then correct storage/modification/catalog/controller/product/product.php.
Negative number shouldn't matter as the warnings are caused by bots setting the page to non-numeric values.
system/library/pagination.php won't be an issue if the (int) in added in the other files.
Once you have made the changes, refresh your modifications. This will then correct storage/modification/catalog/controller/product/product.php.
Thanks, so far so goodADD Creative wrote: ↑Fri Mar 24, 2023 8:18 pmYes, you just have to add (int) in front of $this->request->get['page'] for all those files.
Negative number shouldn't matter as the warnings are caused by bots setting the page to non-numeric values.
system/library/pagination.php won't be an issue if the (int) in added in the other files.
Once you have made the changes, refresh your modifications. This will then correct storage/modification/catalog/controller/product/product.php.
Who is online
Users browsing this forum: No registered users and 140 guests