-
-
Notifications
You must be signed in to change notification settings - Fork 16
Only attempt to decrement orders after delete #30
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
Conversation
|
Tests failing. Simply changing the callback method won't cut it. All fields required to calculate the new orders might not be available in provided entity in which case the So the Also please add a test case using table with unique index for the sequence field 🙂. |
|
👍 |
|
@ADmad Should be all good now! |
| * records that were after it in the set. | ||
| * | ||
| * @param \Cake\Event\Event $event The beforeDelete event that was fired. | ||
| * @param \Cake\Event\Event $event The afterDelete event that was fired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be undone.
| * records that were after it in the set. | ||
| * | ||
| * @param \Cake\Event\Event $event The afterDelete event that was fired. | ||
| * @param \Cake\ORM\Entity $entity The entity that is going to be saved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entity that was deleted.
|
@ADmad Fixed. Can't believe I missed that! |
Doing this in the beforeDelete breaks in cases where the sequencing is a unique index.