- Issue created by @jonathanshaw
- Merge request !25Draft: Resolve #3412904 "Completed timestamp logic" β (Closed) created by jonathanshaw
- Status changed to Needs review
6 months ago 3:45pm 6 January 2024 - πΊπΈUnited States john.oltman
john.oltman β made their first commit to this issueβs fork.
- Merge request !26Issue #3412904: Completed timestamp logic is brittle β (Merged) created by john.oltman
-
john.oltman β
committed 9412f93b on 3.1.x
Issue #3412904: Completed timestamp logic is brittle
-
john.oltman β
committed 9412f93b on 3.1.x
- Status changed to Fixed
6 months ago 9:23pm 6 January 2024 - πΊπΈUnited States john.oltman
Thanks for the post, another good catch @jonathonshaw! I could not take your MR because it is possible for a canceled registration to have a completed timestamp if it was completed and then subsequently canceled. Also, it is not valid for a registration to be completed and not have a completed timestamp. As you point out in your issue description, entity Presave is not a good place for the timestamp logic because other modules may have presave hooks or presave subscribers that set the state after it. So I moved the logic into a low priority presave subscriber - this event is triggered by registration storage, right before the actual db save is going to occur, so it runs after any presave hooks. I added a test and confirmed it failed when the logic was in the entity preSave function.
I committed the fix to dev branch - since I just did a release recently, I'm going to see what other issues arise and then do a release in early February.
Automatically closed - issue fixed for 2 weeks with no activity.