Error when saving Additional info on order

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
2 years 10 months ago #338332

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.4
-- PHP version -- : 8.0.14
-- Error-message(debug-mod must be tuned on) -- : # Function Location
1 () JROOT/administrator/components/com_hikashop/classes/order.php:1165
2 hikashopOrderClass->saveForm() JROOT/administrator/components/com_hikashop/controllers/order.php:608
3 OrderController->save() JROOT/libraries/src/MVC/Controller/BaseController.php:702
4 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2286
5 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:73
6 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
7 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
8 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
9 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
10 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:225
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51

Hi

When I on an order edit additional info and click save, I get this error and nothing is saved:

An error has occurred.
0 count(): Argument #1 ($value) must be of type Countable|array, string given

Any way to fix this?

Regards
Thomas

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 10 months ago #338334

Hi,

Thanks for the report.
Change the line:

if( !empty($value) || count($value) > 0 )
to:
if( !empty($value) || (is_array($value) && count($value) > 0 ))
in the file administrator/components/com_hikashop/classes/order.php and it will fix the problem.
We'll add the fix on our end.

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

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
2 years 10 months ago #338353

Works, thanks!

The following user(s) said Thank You: nicolas

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

Time to create page: 0.051 seconds
Powered by Kunena Forum