News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Fatal error when update order

Started by sandomatyas, December 14, 2017, 08:19:40 AM

Previous topic - Next topic

sandomatyas

There is a custom script of mine which updates some selected orders when an external feed gives a payment validation. It's a daily script so there is a loop which gets an array of order numbers and does the following:

foreach($order_numbers as $order_number)
{
$virtuemart_order_id = $modelOrder->getOrderIdByOrderNumber($order_number);
$order = $modelOrder->getOrder($virtuemart_order_id);

// some validation

$order['order_status'] = 'F';
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

$sum += $order['details']['BT']->order_total;

unset($order);
}


it works if the array contains 2-3 elements but if there are ~8-10 elements I get this error message:
QuoteFatal 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 memory limit is 2GB

Any guess?

Jörgen

This issue has been reported before when updating multiple order in the back end. I will recall that this had something to do with allocating memory for language that made som extra calls that allocated to much memory. I Think this has been corrected. What VM version ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.