Rating error helpful comment

  • Posts: 413
  • Thank you received: 15
8 months 2 weeks ago #355355

-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4
-- PHP version -- : 8.1.17
-- Browser(s) name and version -- : Google Chrome 117

Hi, I'm getting the following error when rating a helpful comment: POST http://localhost/demo/index.php/component/hikashop/vote/save?tmpl=component 500 (Internal Server Error)

0 round(): Argument #1 ($num) must be of type int|float, string given

Last edit: 8 months 2 weeks ago by neo191987.

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

  • Posts: 4580
  • Thank you received: 616
  • MODERATOR
8 months 2 weeks ago #355359

Hello,

Can you active the Joomla Debug at maximum level, and process a screenshot in order to show us everything?
This will allow us to better understand the error and his context.

Regards

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

  • Posts: 413
  • Thank you received: 15
8 months 2 weeks ago #355373
Attachments:

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

  • Posts: 413
  • Thank you received: 15
8 months 2 weeks ago #355376

fixed

components/com_hikashop/controllers/vote.php

row 72 and 73

$return['values'] = array('average' => round($voteClass->values['average'],2), 'rounded' => round($voteClass->values['average']), 'total' => $voteClass->values['total']);
$return['tooltip'] = JText::sprintf('HIKA_VOTE_TOOLTIP',round($voteClass->values['average'],2),$voteClass->values['total'],$element->vote_rating);

changed to
$return['values'] = array('average' => round((float)$voteClass->values['average'],2), 'rounded' => round((float)$voteClass->values['average']), 'total' => $voteClass->values['total']);
$return['tooltip'] = JText::sprintf('HIKA_VOTE_TOOLTIP',round((float)$voteClass->values['average'],2),$voteClass->values['total'],$element->vote_rating);

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

  • Posts: 81837
  • Thank you received: 13138
  • MODERATOR
8 months 2 weeks ago #355378

Hi,

Thank you for the details and the patch. We've added it on our end.
For others with the issue, you can download the install package of HikaShop on our website and install it on yours and it will automatically apply the patch.

The following user(s) said Thank You: neo191987

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

Time to create page: 0.073 seconds
Powered by Kunena Forum