VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: kratzi on September 14, 2017, 20:04:55 PM

Title: Updating status of multiple shippings at same time results in a blank site
Post by: kratzi on September 14, 2017, 20:04:55 PM
Hi I have updated my shop to J 3.7.5 and VM 3.2.4

I have a really bad error which I could not see while testing because I always only updated 1 or two orders at the same time.

When updating multiple orders at once (f.e. more than 6) I end up with a blank page. I can not reload the page otherwise it will repeat the process. Customers will receive their email double and I will have two same entries for shipped orders.

When I then look at my orders it is clear that only few orders got updated.

Any idea what the issue here is. My memory_limit is set to 265 so I would say this could be excluded.

Regards


Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: GJC Web Design on September 14, 2017, 23:28:26 PM
blank page is a 500 error so it will be logged somewhere

if the pdf invoice is being created for each order ti could run out of memory

make some test orders, tun up all logging and debug and try updating multiple orders
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: kratzi on September 15, 2017, 12:54:25 PM
The error I get after I enabled debug is:

QuoteFatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in ../administrator/components/com_virtuemart/helpers/vmlanguage.php on line 246

Line 246 of the below code is self::$_loaded['com'][$site][] = $name; . Maybe connected to the issue I reported in in another post: http://forum.virtuemart.net/index.php?topic=138389.0



/**
* loads a language file, the trick for us is that always the config option enableEnglish is tested
* and the path are already set and the correct order is used
* We use first the english language, then the default
*
* @author Max Milbers
* @static
* @param $name
* @return bool
*/
static public function loadJLang($name, $site = false, $tag = 0, $cache = true){

static $loaded = array();
//VmConfig::$echoDebug  = 1;
if(empty($tag)) {
$tag = self::$currLangTag;
}
$site = (int)$site;
self::$_loaded['com'][$site][] = $name;
self::getLanguage($tag);

$h = $site.$tag.$name;
if($cache and isset($loaded[$h])){
vmText::$language = self::$languages[$tag];
return self::$languages[$tag];
} else {
if(!isset(self::$languages[$tag])){
vmdebug('No language loaded '.$tag.' '.$name);
VmConfig::$logDebug = true;
vmTrace('No language loaded '.$tag.' '.$name,true);
return false ;
}
}



Maybe coincidence but what I could observe is that if I update multiple orders which are all in a row the error will not come up. However If you update multiple orders but leave some orders out of updating the error will occur.

Quoteif the pdf invoice is being created for each order ti could run out of memory

I have not created any PDF invoice for any of these orders. But for some reason yes the whole order update takes a huge amount of memory in my case.

Would be nice someone could test.

Thank you
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: jenkinhill on September 15, 2017, 13:12:05 PM
You run out of PHP memory when making so many updates at once. That is what the error message tells you. I guess you have memory_limit  in the server php.ini set to 256M and that is not enough for what you are trying.  - increase it to 512M
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: Ventsi Genchev on September 15, 2017, 13:19:11 PM
You can also try the patch that Max has made:
http://dev.virtuemart.net/projects/virtuemart/repository/revisions/9632
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: kratzi on September 15, 2017, 13:38:46 PM
QuoteYou run out of PHP memory when making so many updates at once. That is what the error message tells you. I guess you have memory_limit  in the server php.ini set to 256M and that is not enough for what you are trying.  - increase it to 512M

It is not like I would update hundreds of orders at once. Usually about 10-20. And it already worked for years now.

@ Venci Gentchev

Thank you for pointing me to the file. It helped a lot and the issue is gone. I appreciate your help.

Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: mahootshop on September 30, 2017, 09:33:06 AM

its a bug report of virtuemart 3.2.4  on joomla 3.7.5

after trying to update order statuses more than 7 order in orders list (batch them) we recieve:
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 1073741832 bytes) in (***)/administrator/components/com_virtuemart/helpers/vmlanguage.php on line 246


the line 246 is :
  $tag = self::$currLangTag;
    self::$_loaded['mod'][] = $name;



replace with virtuemart 3.2.2 code which is:

$tag = self::$currLangTag;;

:)) with one ; ofcourse


the problem is solved.

info for undrestanding the situation:
our virtuemart has one language in front end
Configs:
Use english as fallback for untranslated strings: checked
Multilingual shop: one language is there(its persian(IR))
No Fallback:  checked
Custom Fallback: NO
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: Studio 42 on October 02, 2017, 00:34:44 AM
Quote from: mahootshop on September 30, 2017, 09:33:06 AM

its a bug report of virtuemart 3.2.4  on joomla 3.7.5

after trying to update order statuses more than 7 order in orders list (batch them) we recieve:
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 1073741832 bytes) in (***)/administrator/components/com_virtuemart/helpers/vmlanguage.php on line 246
patch
http://dev.virtuemart.net/projects/virtuemart/repository/revisions/9632 is a better solution
Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: mahootshop on October 02, 2017, 05:58:20 AM
We are talking about a bug in version 3.2.4,  and the solution took from 3.2.3.
Sorry I can't understand, why 3.0.12 is modified?

Sent from my LG-H818 using Tapatalk

Title: Re: Updating status of multiple shippings at same time results in a blank site
Post by: jenkinhill on October 02, 2017, 12:19:17 PM
In the repository com_virtuemart.3.0.12.4 is the branch containing the latest files.