Skip to content

Commit

Permalink
Update category.php
Browse files Browse the repository at this point in the history
This line 108 giving error:
Unknown: html_entity_decode(): Passing null to parameter opencart#1 ($string) of
type string is deprecated in
/home/upload/catalog/controller/product/category.php on line 108

When i asked Journal theme support they suggested  these changes adding these ( ?? ''  before  , ENT 

if ($category_info['image'] && is_file(DIR_IMAGE . html_entity_decode($category_info['image'], ENT_QUOTES, 'UTF-8'))) {
with

if ($category_info['image'] && is_file(DIR_IMAGE . html_entity_decode($category_info['image'] ?? '', ENT_QUOTES, 'UTF-8'))) {

and now this is working.
  • Loading branch information
mmsaaa1 committed Nov 29, 2022
1 parent d97f086 commit 11109d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upload/catalog/controller/product/category.php
Expand Up @@ -105,7 +105,7 @@ public function index(): void {
'href' => $this->url->link('product/category', 'language=' . $this->config->get('config_language') . '&path=' . $this->request->get['path'])
];

if (is_file(DIR_IMAGE . html_entity_decode($category_info['image'], ENT_QUOTES, 'UTF-8'))) {
if (is_file(DIR_IMAGE . html_entity_decode($category_info['image'] ?? '', ENT_QUOTES, 'UTF-8'))) {
$data['thumb'] = $this->model_tool_image->resize(html_entity_decode($category_info['image'], ENT_QUOTES, 'UTF-8'), $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
} else {
$data['thumb'] = '';
Expand Down

0 comments on commit 11109d3

Please sign in to comment.