Ticket #266 (closed defect: fixed)
Deleting items from plural relationships are committed event when record not validated
| Reported by: | dhughes | Owned by: | somebody |
|---|---|---|---|
| Priority: | highest | Milestone: | |
| Version: | Severity: | blocker | |
| Keywords: | Cc: |
Description
If you have an object which as a plural/many to many relationship with another object, if you indicate that a related record should be deleted via your form post, the item is removed from the relationship even if the record does not validate.
This was a result of two things: 1) reactor wouldn't let you do deletes on an iterator in your own transaction and 2) the ModelGlue? GenericORMController didn't(couldn't) roll back transactions when validation failed. 3) the ModelGlue? ReactorAdaptor? didn't attempt (because it wasn't possible till now) to run delete related items in a transaction.
I've already implemented the fix needed in Reactor. Attached to this report is a new GenericOrmController? that uses cftransaction to manage the commit and validation.
What's changed is the cftransaction tag on line 130, a commit on 152, a rollback on 158 and the close cftransaction tag.
Also attached is a new ReactorAdaptor? (that includes fixes for tickets #265 and #264). This changes the call to the delete method on the iterator so that the useTransation argument is set to false (allowing us to use the one we started in GenericOrmController?.
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)