Author Topic: Multi-Variants crash when more than about 90 Variants are created  (Read 418 times)

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Hi all,

I would appreciate if anyone can check the code for multi-variants for array-bounds or the likes.
Creating more than 90-120 Variants of a product fails while filling the combinations in the multi-variant edit dialog.
The page hangs or, even worse, deletes all previously entered combinations /attributes for the multi-variant.

I'd also appreciate if someone could point me to the right PHP code where this could origin from.

Thanks a lot
Stefan

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26042
  • Always on vacation
    • Jenkin Hill Internet
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #1 on: March 17, 2017, 15:39:42 pm »
You probably have reached the PHP memory limit on your server. Look to increase memory_limit in php.ini  - See http://forum.virtuemart.net/index.php?topic=131863.msg478850#msg478850  for suggestions
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.3.9579 on Joomla 3.7.3 PHP 7.0.19

Testing VMVM3.2.4 on J!3.7.3

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #2 on: March 21, 2017, 14:00:48 pm »
Hi jenkinhill,

thanks for your suggestions. I have changed php.ini accordingly. Unfortunately the error stays the same.
Will the webserver need to be rebooted or does it read the changed ini file ? Also, is there a way to
check if the memory settings have succeeded ?

Thanks
Stefan

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26042
  • Always on vacation
    • Jenkin Hill Internet
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #3 on: March 21, 2017, 15:08:32 pm »
Some shared servers have maximum limits which cannot be overwritten no matter what you set in php.ini  In most cases it is recommended to restart Apache after changing the "master" php.ini although I use a cloud VPS where just editing the php.ini allocated to a domain is all that is required.

You can check the values in Joomla's system information, although this may just give the php.ini set values and not the actual values.  So have a look at https://magazine.joomla.org/issues/issue-dec-2010/item/295-Are-you-getting-your-fair-share-of-PHP-memory
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.3.9579 on Joomla 3.7.3 PHP 7.0.19

Testing VMVM3.2.4 on J!3.7.3

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #4 on: March 21, 2017, 17:10:38 pm »
It was in fact not necessary to reboot apache. I have greatly increased the memory limits including memory_limit which is set to 512M.
So there must be something else - I have turned on error logging in php.ini.

Let's see what this yields.

Thanks

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #5 on: March 21, 2017, 18:35:22 pm »
The problem seems to be fixed now. The root cause was the customfield_params field in the virtuemart_product_customfields table.
It was varchar(17000) which was not sufficient for the use case. So I changed that to a text field and now I can save large number of variants in the
custom fields page.

Thanks jenkinhill anyway for your swift answers


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9085
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #6 on: March 21, 2017, 22:09:38 pm »
Be aware that updating VM changes this back to varchar(17000). As far I can see, it wont work with the hidden config. I changed it now to text. So when you update, use directly vm3.2.1, then.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #7 on: March 29, 2017, 15:49:00 pm »
thanks Milbo, I appreciate your swift help.

I will go to 3.2.1 at the next chance

brandiware

  • Beginner
  • *
  • Posts: 27
  • A beginner
Re: Multi-Variants crash when more than about 90 Variants are created
« Reply #8 on: April 06, 2017, 17:25:32 pm »
Based on Milbo's invaluable help - further crashes with large numbers of variants are solved:
- the table virtuemart_customs needed the same field changed to text (these changes are, according to Milbo, included in the latest VM release)
- also the max_input_vars php variable needed an upgrade.