Error cart and wishlist

  • Posts: 19
  • Thank you received: 1
  • Hikashop Business
1 year 6 months ago #346054

-- url of the page with the problem -- : none
-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.4
-- PHP version -- : 8.1.9
-- Browser(s) name and version -- : firefox 106.0.2
-- Error-message(debug-mod must be tuned on) -- : Uncaught Throwable of type TypeError thrown with message "count(): Argument #1 ($value) must be of type Countable|array, null given". Stack trace: #0 [ROOT]/libraries/src/MVC/View/HtmlView.php(410): include()
#1 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2707): Joomla\CMS\MVC\View\HtmlView->loadTemplate()
#2 [ROOT]/libraries/src/MVC/View/HtmlView.php(203): hikashopView->loadTemplate()
#3 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2662): Joomla\CMS\MVC\View\HtmlView->display()
#4 [ROOT]/administrator/components/com_hikashop/views/cart/view.html.php(22): hikashopView->display()
#5 [ROOT]/libraries/src/MVC/Controller/BaseController.php(639): CartViewCart->display()
#6 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2385): Joomla\CMS\MVC\Controller\BaseController->display()
#7 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2143): hikashopController->display()
#8 [ROOT]/libraries/src/MVC/Controller/BaseController.php(672): hikashopController->add()
#9 [ROOT]/administrator/components/com_hikashop/helpers/helper.php(2363): Joomla\CMS\MVC\Controller\BaseController->execute()
#10 [ROOT]/administrator/components/com_hikashop/hikashop.php(73): hikashopController->execute()
#11 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): require_once('/home/id2787516...')
#12 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(73): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()
#13 [ROOT]/libraries/src/Component/ComponentHelper.php(355): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()
#14 [ROOT]/libraries/src/Application/AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent()
#15 [ROOT]/libraries/src/Application/AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch()
#16 [ROOT]/libraries/src/Application/CMSApplication.php(294): Joomla\CMS\Application\AdministratorApplication->doExecute()
#17 [ROOT]/administrator/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()
#18 [ROOT]/administrator/index.php(32): require_once('/home/id2787516...')
#19 {main}

Hi,

Under customer --> cart :I get the following message when I click on new: "0 count(): Argument #1 ($value) must be of type Countable|array, null given" when you click on make order, then you get a blank screen, the same happens with wishlist.

what is the cause of this and how can we solve it?

Regards,

Dennis

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
1 year 6 months ago #346055

Hi,

I'm not able to reproduce the issue with the same versions of HikaShop and Joomla on my end.

Your stack trace seems to indicate that the error comes from the line:

include $this->_template;
in the file /libraries/src/MVC/View/HtmlView.php of Joomla because $this->_template is null.
However, reading the code there, $this->_template is set by the line:
$this->_template = Path::find($this->_path['template'], $filetofind);
a few lines before at the same place.
And reading the code of the Path::find function ( in /libraries/src/Filesystem/Path.php ) it can only return false or a string. It can't return null like the error message says.
So even without going deeper into it, I don't see how that's possible.
It would seem to indicate that it can't find the cart / form.php view file (used when creating a new cart). But I don't see why.

We would need to do some debugging directly there to be able to understand what's going on.
Could you provide a backend and FTP access in order to look into it ?
If so, please use our contact form to provide them along with a link to this thread for reference:
www.hikashop.com/support/contact-us.html

Last edit: 1 year 5 months ago by nicolas.

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

  • Posts: 19
  • Thank you received: 1
  • Hikashop Business
1 year 5 months ago #346096

Hi,

Nicolas,

The site details are sent.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
1 year 5 months ago #346100

Hi,

Thank you for the access. I actually got another call stack when reproducing the error on your website:
i.imgur.com/irkrxBy.png
And this is much more logical. I've made a patch for it on my end.
Download again the install package of HikaShop on our website and install it on yours and it will fix the problem.

The following user(s) said Thank You: Dnsftl

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

  • Posts: 19
  • Thank you received: 1
  • Hikashop Business
1 year 5 months ago #346104

Hi Nicholas,

Downloaded and installed, it now works perfectly. Thanks for the assistance.

Regards Dennis

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

Time to create page: 0.065 seconds
Powered by Kunena Forum