Failed restore causes later updates to fail #793
Unanswered
goodevilgenius
asked this question in
Q&A
Replies: 1 comment
-
|
Hi, If you know how to solve it please make a PR with some tests to avoid breaking that on the future, thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Actual Behaviour
Update audit event does not occur if a previous restore failed.
Expected Behaviour
Update should happen regardless of previous restore.
Steps to Reproduce
Image code along the following lines:
Because
$model1->restorefailed, therestoredmodel event was never fired. Because of this,AuditableObserver::$restoringis still set to true.Because
AuditableObserver::$restoringis stilltrue,$model2->updatedoesn't trigger theupdatedaudit event.Possible Solutions
I worked around this locally by modifying my model to have a
$restoringproperty initialized tofalse. I then created my ownrestoremethod like this:I then extended
AuditableObserverand overrode theupdatedmethod like this:And then, of course, overrode the
bootAuditablemethod to observe my newAuditableObserver.Beta Was this translation helpful? Give feedback.
All reactions