Summary
There is an error in logic for Oro\Bundle\TaxBundle\Manager\TaxValueManager::flushTaxValueIfAllowed that may lead to PHP Fatal Error
Steps to reproduce
Disable taxation in admin panel:
Create an order (on front-store or from an admin panel):
Enable taxation in admin panel
Click to Edit the created Order, update Line Item quantity or price, Click Save button:
Actual ResultPHP Fatal error: Allowed memory size of 2147483648 bytes exhaustedPHP Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
Additional information
I believe the problem is in Oro\Bundle\TaxBundle\Manager\TaxManager and TaxValueManager.
Tax value was not set for the above Order, TaxManager is trying to save it in the saveTax method and flush changes to DB.
Oro\Bundle\TaxBundle\Manager\TaxValueManager::flushTaxValueIfAllowed should check isFlushInProgress for TaxValueEntityManager, but for the above case changes are made with transaction and managed by Order entity manager, so $em->flush($entity); is called permanently and finally leads to PHP Fatal Error.
Details about your environment
OroCommerce versions: 4, 5 (Community and Enterprise)
Summary
There is an error in logic for
Oro\Bundle\TaxBundle\Manager\TaxValueManager::flushTaxValueIfAllowed
that may lead to PHP Fatal ErrorSteps to reproduce
Disable taxation in admin panel:
Create an order (on front-store or from an admin panel):
Enable taxation in admin panel
Click to Edit the created Order, update Line Item quantity or price, Click Save button:
Actual Result
PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted
PHP Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
Additional information I believe the problem is in
Oro\Bundle\TaxBundle\Manager\TaxManager
andTaxValueManager
.Tax value was not set for the above Order, TaxManager is trying to save it in the
saveTax
method and flush changes to DB.Oro\Bundle\TaxBundle\Manager\TaxValueManager::flushTaxValueIfAllowed
should check isFlushInProgress for TaxValueEntityManager, but for the above case changes are made with transaction and managed by Order entity manager, so$em->flush($entity);
is called permanently and finally leads to PHP Fatal Error.Details about your environment