Warning trim() expects parameter 1 to be string, array given in

  • Posts: 31
  • Thank you received: 1
2 years 11 months ago #337613

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 3.10.3
-- PHP version -- : 7.3
-- Browser(s) name and version -- : chrome 96.0.4664.45
-- Error-message(debug-mod must be tuned on) -- : Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Warning: trim() expects parameter 1 to be string, array given in /home/matrivub/public_html/components/com_hikashop/views/product/tmpl/filter.php on line 67

Hello, in default mode in Joomla a saw a fowolling warning:
0
Warning: trim() expects parameter 1 to be string, array given in ...........

I`ve donwloading the filter.php file and scrol down to 67 row. Here are the code at the rows 67,68,69:

if(!empty($data) && !in_array(trim($data), array('', 'none', '::'))) {
$filter->filterActive = true;
$filterActivated = true;

WHAT CAN I DO TO FIX THE WARNING IN DEFAULT JOOMLA MODE TO DISSAPEAR THE WARNING?
Is the code below right?

if(!empty($data) && !in_array(trim($data), array('', 'none', '::'))) {
$filter->filterActive = false;
$filterActivated = false;

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 11 months ago #337617

Hi,

Thank you for your feedback. The code there has indeed a problem because for some types of filters $data can be an array. So the check there should be a bit more complex.
I've made a patch on our end for this.
Download again the install package of HikaShop on our website and install it on yours and it will fix the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 1
2 years 11 months ago #337635

Hello, I`ve diwnloaded and installed on my web site the new release, but still seen other error in the same filter php file:
Notice: Undefined offset: 1 in /home/matrivub/public_html/administrator/components/com_hikashop/classes/filter.php on line 882

and other

Notice: Undefined offset: 1 in /home/matrivub/public_html/administrator/components/com_hikashop/classes/filter.php on line 899

Last edit: 2 years 11 months ago by marto42.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 11 months ago #337641

Hi,

Well it's another notice message in another file and I didn't know about it so that's why it's still there.
I've added a patch for

Notice: Undefined offset: 1 in /home/matrivub/public_html/administrator/components/com_hikashop/classes/filter.php on line 899
Download again the install package of HikaShop on our website and install it on yours and it will fix the problem.

However, for the
Notice: Undefined offset: 1 in /home/matrivub/public_html/administrator/components/com_hikashop/classes/filter.php on line 882
I don't see why you would get that message. Could you double check ? What do you have on that line of code in that file on your end ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.112 seconds
Powered by Kunena Forum