We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sylius version affected: 1.12.14
Description When removing adjustments, if two $entityManager->flush() are played in succession, the following doctrine message appears:
$entityManager->flush()
A managed+dirty entity App\Entity\Order\Adjustment@11699 cannot be scheduled for insertion.
This is because shipping adjustments are not removed from the shipment when removing adjustments at the order level.
Steps to reproduce
Use the endpoint /shop/orders/{tokenValue}/complete Add a new callback on complete transition & send an email.
/shop/orders/{tokenValue}/complete
Email will be send via messenger, an a flush() will be played a first time. ApiPlatform will also use messenger for this action and will flush() too.
flush()
Possible Solution
public function removeAdjustment(AdjustmentInterface $adjustment): void { if (!$adjustment->isLocked() && $this->hasAdjustment($adjustment)) { $this->adjustments->removeElement($adjustment); $this->subtractFromAdjustmentsTotal($adjustment); $adjustment->setAdjustable(null); // Here the fix $adjustment->setShipment(null); $this->recalculateAdjustmentsTotal(); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sylius version affected: 1.12.14
Description
When removing adjustments, if two
$entityManager->flush()
are played in succession, the following doctrine message appears:A managed+dirty entity App\Entity\Order\Adjustment@11699 cannot be scheduled for insertion.
This is because shipping adjustments are not removed from the shipment when removing adjustments at the order level.
Steps to reproduce
Use the endpoint
/shop/orders/{tokenValue}/complete
Add a new callback on complete transition & send an email.
Email will be send via messenger, an a
flush()
will be played a first time.ApiPlatform will also use messenger for this action and will
flush()
too.Possible Solution
The text was updated successfully, but these errors were encountered: