Restriction of variants to some user groups doesn't work

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322616

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.3.20
-- Browser(s) name and version -- : Firefox, Safari, Chrome
-- Error-message(debug-mod must be tuned on) -- : Notice: Undefined property: stdClass::$product_type in /home/httpd/vhosts/elcase.ch/httpdocs/plugins/hikashop/shippingmanual_prices/shippingmanual_prices.php on line 131

Hi,

If we add or edit a variant in a product and restrict this variant to some user groups, not all groups are checked after saving the article. If Joomla error reporting is set to maximum I get this message: Notice: Undefined property: stdClass::$product_type in /home/httpd/vhosts/elcase.ch/httpdocs/plugins/hikashop/shippingmanual_prices/shippingmanual_prices.php on line 131. My client has 247 user groups because of individual prices.

Steps to reproduce:

1. add a lot of user groups ;-)
2. edit a variant inside an article
3. scroll down to 'Restrictions and dimensions'
4. disable the checkbox for 'public' and 'guest'
5. save the article

After saving the article only the first approx. 80 checkboxes are enabled and saved correct. I think there is some bug insade a script? If I check 'all' everything works like expected.

Do you can please try to reproduce this? Do you need backend access?

Regards,
Stefan

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
3 years 8 months ago #322621

Hi,

I don't think it's a bug inside a script.
I think it's a limitation on the server to limit the number of parameters to be taken into account in the POST:
stackoverflow.com/questions/9399315/how-...post-variable-in-php
As you can read there, it can be a variable in the php.ini, or in suhosin, or in the httpd.conf or in a htaccess.
To circumvent the problem, what you can do is click on the "save" button of the variant edition form (below the variants listing on the right side) instead of the "save" button of the whole page. That way, it will only save the variant data instead of the product data + the variant data. And then, when you want to leave the product edition page, either close the variant before clicking on the main save button or click on the cancel button to go back to the products listing.

The notice message in the shipping prices plugin is not linked and will be fixed in the next release of HikaShop.

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

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322675

Hi Nicolas,

thanks for your advice. We have raised the max_input_vars value to 200000, unfortunately the problem does still exist. Even if i use the 'save' button of the variant edition form. In some further testing I've found out that this problem appears not only in the variants, but in the 'Restrictions and dimensions' of the product too.

Some other php settings:
max_execution_time: 240
max_file_uploads: 100
max_input_nesting_level: 64
max_input_time: 240
max_input_vars: 200000

I have no more ideas what the cause might be. Please help me, this shop is online and the customer had to deactivate some products because of this problem.

Regards,
Stefan

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
3 years 8 months ago #322678

Hi,

Well, you finding the issue with the "restrictions and dimensions" settings only confirms the diagnosis I made.
When the server is restricting the number of parameters that can be received, all the parameters above that limit will be ignored.
So that means that all the options displayed after the "breaking point" in the interface will be ignored by the server.

You've increased the max_input_vars variable of PHP but did you check suhosin's configuration ? You can find more information on that in the second answer of the link I gave: stackoverflow.com/questions/9399315/how-...post-variable-in-php
Suhosin's settings is a common cause for that problem.

If that doesn't work either, I could have a look at your backend, but so far, in the last ten years of supporting HikaShop, each and every time this issue was reported to us, it was because of a server limitation on the parameters count, nothing we could do about even with a backend or a FTP access :/

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

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322711

Hi,

I've made a lot of tests with the hosting provider support with no results. We increased the possible php settings maximum to max. Suhosin is not active on this server.

After this I've copied the whole Website to another Server with the same result, unfortunately.

So it would be very helpful, if you could have a look in the backend. You find the login data below.

Thank you very much
Stefan

Last edit: 3 years 8 months ago by smart web.

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
3 years 8 months ago #322712

Hi,

Ok, the problem is slightly different here.
It's not the number of input parameters that is restricted. And it's not a problem of having a lot of user groups on your website either.
It's the length of the product_access column in the hikashop_product table which has a maximum number of characters and you're trying to select a lot of groups, so only the first ones are taken into account.
If you need to select user groups, you need to change the type of that product_access column to text instead of varchar via your phpmyadmin.

The following user(s) said Thank You: smart web

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

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322757

Thank you, Nicolas. After changing product_access column to text, everything is working fine.

Last edit: 3 years 8 months ago by smart web.

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

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322767

I'm afraid I was celebrating too soon. My client has reported another similar problem.
The user group assignment of a variant itself works perfectly. The assignment of a price to certain user groups within a variant still does not work.
The behavior is identical to the previous problem. Can you please check how this problem can be solved?

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
3 years 8 months ago #322785

Hi,

That's normal, for the prices it's the column price_access of the hikashop_price table.
And I can already tell you that you'll have the same problem for every other "access level" setting.
For example, you have the payment_access column in the hikahop_payment table, the discount_access column in the hikashop_discount table, the taxation_access column in the hikashop_taxation table, the shipping_access column in the hikashop_shipping table, the category_access column in the hikashop_category table (and maybe others I'm forgetting)

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

  • Posts: 38
  • Thank you received: 4
  • Hikashop Business
3 years 8 months ago #322833

Thank you, Nicolas.
My customer has reported that everything is now functioning properly again.
Do we have to expect to repeat these changes after the next update or will the column type be changed to text in the following versions?

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

  • Posts: 12953
  • Thank you received: 1778
3 years 8 months ago #322841

Hello,

I don't think you'll have to change it again as after every update Hikashop will only add / change database fields that were modified.

Kind regards,
Mohamed.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum