Error on HikaShop Google Products Plugin

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
2 years 4 months ago #337276

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 4.0.4
-- PHP version -- : 8.0.12

Hi,

I'm having an issue with the Google products plugin.
As soon as I open the plugin it give this error:

0 htmlspecialchars(): Argument #1 ($string) must be of type string, array given
In the console I see that a 500 error is presented with this as part of the GET:
administrator/index.php?option=com_plugins&view=plugin&layout=edit&extension_id=10147
I don't have a clue what that means. Any ideas?
It's Joomla 4.04, Hika 4.4.4 and PHP 8.0.12
If I switch back to PHP 7.4 then I can get into the plugin again.

But when hitting the trigger button at the bottom this nice present is shown:
An error has occurred.
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND product_access LIKE '%,0,%')' at line 1

So I'm a bit stuck and not sure what to do next in trying to find a solution.

Thanks for your reply in advance.

Last edit: 2 years 4 months ago by Joomill.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
2 years 4 months ago #337287

Hi,

It will be hard to say without more details on both errors.
Could you please reproduce the errors after activating the "erro reporting" and "debug system" settings of the Joomla configuration ?
That way, you'll get more information on the errors and we'll be able to better understand what's going on and provide a solution.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
2 years 4 months ago #337294

Hi,
I've turned on the debug etc. and send a SuperUser account through contact.
Maybe better to see it on the site then pasting large texts in here :P

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
2 years 4 months ago #337296

Hi,

So I was able to see the details for the first bug.
It the same as this one:
github.com/joomla/joomla-cms/issues/32334
It's a shame they dropped backward compatibility for this in Joomla 4.
But the fix is actually easy. You just need to change the line:

<field name="user_group" type="usergroup" size="50" label="USER_GROUP_PRODUCTS" description="GOOGLE_PRODUCTS_USER_GROUP" multiple="true"/>
to:
<field name="user_group" type="usergrouplist" size="50" label="USER_GROUP_PRODUCTS" description="GOOGLE_PRODUCTS_USER_GROUP" multiple="true"/>
in the file plugins/hikashop/google_products/google_products.xml
We'll do that on our end too.

For the second error, I couldn't see it since it requires to first be able to access the settings page of the plugin.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
2 years 4 months ago #337299

Hi, I updated the line in the xml file.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
2 years 4 months ago #337304

Hi,

Thanks.
Change the ligne:

$acl_filters[] = ' AND product_access '."LIKE '%,".(int)$userGroup.",%'";
to:
$acl_filters[] = 'product_access '."LIKE '%,".(int)$userGroup.",%'";
in the same file and it will fix the second problem.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
2 years 4 months ago #337318

Hi, Ik can now click the trigger without errors so looking good.

Many thanks !

Just a small correction, the line was not in the same file but in the php file ;)

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
2 years 4 months ago #337319

Hi,

Ah yes, I was thinking about the PHP file of the error. My bad for not being precise. Thanks for mentionning it.

We'll add the fixes on our end of course.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum