Array notification on payment and shipping methods

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #347095

-- url of the page with the problem -- : cyclostyle.com
-- HikaShop version -- : 4.7.0
-- Joomla version -- : 3.10.11
-- PHP version -- : 8.0
-- Browser(s) name and version -- : firefox
-- Error-message(debug-mod must be tuned on) -- : Array to string conversion in /customers/c/7/8/cyclostyle.com/httpd.www/administrator/components/com_hikashop/views/plugins/tmpl/form.php on line 61 Array

Hey again,

When opening a payment or shipping method in the backend, a notification 'Array' is shown. With the following error message:
Array to string conversion in /customers/c/7/8/cyclostyle.com/httpd.www/administrator/components/com_hikashop/views/plugins/tmpl/form.php on line 61 Array

I checked the file, but there is no difference in the installed form.php and the form.php in the Hikashop installation folder. My knowledge of PHP is not sufficient to solve this, but as it is the original file I can not imagine there is something wrong with it. Can you tell me what causes the error, and how to solve it?

(I found a thread from three years ago with the same error, but that had something to do with stripe. I started usiing Mollie, but that has nothing to do with the shipping methods)( www.hikashop.com/forum/payment-methods/8...stripe-v3-error.html )

Thanks already, Arjan

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347099

Hi,

On this line, you should have this code:

echo implode("\r\n", $this->extra_blocks);
So what it does is that it assumes that the variable $this->extra_blocks is an array of strings (text) and combine all the strings of that array, separated by a carriage return and then output all that to the page.
The variable $this->extra_blocks is initialise by HikaShop as an empty array. And then between this initialisation and the line where the error happens, there are two things which can fill this variable:
- a plugin implements the onHikaPluginConfiguration event and add elements to the array
- a plugin implements the onHikashopBeforeDisplayView event and add elements to the array
The reason this error popups up is because a plugin has added to that array something which isn't a string.

So in short, the problem is within one of the plugins on your website not added the correct data to that $this->extra_blocks variable.
But it's not possible to know which plugin is doing that with just that error message.
I'm afraid you'll have to disable the plugins one by one to find the one doing that. If it started recently and you installed a plugin recently, try first with this one. It's highly likely to be a payment or shipping plugin.

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

  • Posts: 11
  • Thank you received: 0
  • Hikashop Business
1 year 11 months ago #347118

First I have to pay you a compliment on the way you handle all the questions that come your way, taking the time to explain and pointing me (and many ohers) in the right direction to get problems solved, or even solve them for us. Thanks!

In this thread the cause of the problem turned out to be the Maximenu CK plugin for Hikashop. I will contact Cédric about that as installating the latest version does not solve the issue.

Thanks again Nicolas! Regards,
Arjan

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

Time to create page: 0.061 seconds
Powered by Kunena Forum