You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The order detail model automatically updates the instock value of the related article detail in a pre-update hook. Unfortunately these updates will not be persisted along with the order detail. This is due to the fact that according to the doctrine documentation changes made to an entity inside a pre-update hook will not be committed in the same flush event as the "host" entity. Therefore these changes will stay "pending" until the next (global) flush event. This makes the automatic update of the instock value unpredictable and leads in fact to a lot of problems especially in the order cancellation. Therefore we should fix the automatic update and send Shopware a pull request.
The text was updated successfully, but these errors were encountered:
stefanheppenheimer
changed the title
Fix instock update in pre-update hook of order dezail
Fix instock update in pre-update hook of order detail model
Jan 4, 2017
svenmuennich
added
bug
Issues that describe an unexpected behaviour in an existing functionality.
minor
"bug" issues that are neither "critical" nor "major".
labels
Feb 28, 2018
The order detail model automatically updates the instock value of the related article detail in a pre-update hook. Unfortunately these updates will not be persisted along with the order detail. This is due to the fact that according to the doctrine documentation changes made to an entity inside a pre-update hook will not be committed in the same flush event as the "host" entity. Therefore these changes will stay "pending" until the next (global) flush event. This makes the automatic update of the instock value unpredictable and leads in fact to a lot of problems especially in the order cancellation. Therefore we should fix the automatic update and send Shopware a pull request.
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#preupdate
Shopware 5.2.12 (Order Detail Model)
https://github.com/shopware/shopware/blob/v5.2.12/engine/Shopware/Models/Order/Detail.php#L607-L640
The text was updated successfully, but these errors were encountered: