VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: brandiware on March 17, 2017, 15:15:39 PM

Title: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware on March 17, 2017, 15:15:39 PM
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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: jenkinhill 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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware 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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: jenkinhill 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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware 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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware 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

Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: Milbo 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.
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware 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
Title: Re: Multi-Variants crash when more than about 90 Variants are created
Post by: brandiware 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.