Multi-Variants crash when more than about 90 Variants are created

Started by brandiware, March 17, 2017, 15:15:39 PM

Previous topic - Next topic

brandiware

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

brandiware

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

brandiware

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

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

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brandiware

thanks Milbo, I appreciate your swift help.

I will go to 3.2.1 at the next chance

brandiware

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.