Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in TaxValueManager #152

Open
borisde opened this issue Sep 16, 2022 · 0 comments
Open

Bug in TaxValueManager #152

borisde opened this issue Sep 16, 2022 · 0 comments

Comments

@borisde
Copy link

borisde commented Sep 16, 2022

Summary
There is an error in logic for Oro\Bundle\TaxBundle\Manager\TaxValueManager::flushTaxValueIfAllowed that may lead to PHP Fatal Error

Steps to reproduce

  1. Disable taxation in admin panel:
    oro1

  2. Create an order (on front-store or from an admin panel):
    oro2

  3. Enable taxation in admin panel

  4. Click to Edit the created Order, update Line Item quantity or price, Click Save button:
    oro4

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

oro5

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)
  • PHP version: 8.1.10
  • Database MySQL 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant