

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
37 messages in net.sourceforge.lists.plone-developersRe: CMFFormController should abort th...| From | Sent On | Attachments |
|---|---|---|
| Dorneles Treméa | Nov 9, 2007 3:17 pm | |
| Philipp von Weitershausen | Nov 10, 2007 7:07 am | |
| Dorneles Treméa | Nov 10, 2007 7:58 am | |
| Wichert Akkerman | Nov 10, 2007 12:22 pm | |
| Martin Aspeli | Nov 10, 2007 2:12 pm | |
| Wichert Akkerman | Nov 10, 2007 4:20 pm | |
| Philipp von Weitershausen | Nov 11, 2007 1:32 am | |
| Dorneles Treméa | Nov 11, 2007 5:19 pm | |
| Alan Runyan | Nov 11, 2007 5:20 pm | |
| Martin Aspeli | Nov 11, 2007 5:44 pm | |
| Martin Aspeli | Nov 11, 2007 5:51 pm | |
| Wichert Akkerman | Nov 12, 2007 4:37 am | |
| Sidnei da Silva | Nov 12, 2007 4:43 am | |
| Daniel Kraft | Nov 12, 2007 5:40 am | |
| Martin Aspeli | Nov 12, 2007 5:52 am | |
| Dorneles Treméa | Nov 12, 2007 9:35 am | |
| Wichert Akkerman | Nov 12, 2007 9:56 am | |
| Martin Aspeli | Nov 12, 2007 9:59 am | |
| Martin Aspeli | Nov 12, 2007 10:00 am | |
| Dorneles Treméa | Nov 12, 2007 10:56 am | |
| Martin Aspeli | Nov 12, 2007 11:14 am | |
| Martin Aspeli | Nov 12, 2007 11:21 am | |
| Wichert Akkerman | Nov 12, 2007 11:36 am | |
| Martin Aspeli | Nov 12, 2007 11:41 am | |
| Sidnei da Silva | Nov 12, 2007 11:47 am | |
| Martin Aspeli | Nov 12, 2007 12:04 pm | |
| Dorneles Treméa | Nov 12, 2007 12:28 pm | |
| Dorneles Treméa | Nov 12, 2007 12:34 pm | |
| Dorneles Treméa | Nov 12, 2007 1:29 pm | |
| Wichert Akkerman | Nov 12, 2007 1:32 pm | |
| Martin Aspeli | Nov 12, 2007 1:41 pm | |
| Dorneles Treméa | Nov 12, 2007 1:44 pm | |
| Martin Aspeli | Nov 12, 2007 1:46 pm | |
| Wichert Akkerman | Nov 12, 2007 1:46 pm | |
| Martin Aspeli | Nov 12, 2007 1:47 pm | |
| Dorneles Treméa | Nov 12, 2007 5:11 pm | |
| Daniel Nouri | Nov 13, 2007 4:14 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: CMFFormController should abort the current transaction when the validation fails | Actions... |
|---|---|---|
| From: | Wichert Akkerman (wich...@public.gmane.org) | |
| Date: | Nov 12, 2007 9:56:16 am | |
| List: | net.sourceforge.lists.plone-developers | |
Previously Dorneles Treméa wrote:
Hey Martin,
No, I mean, it's a (serious, but discoverable) bug in the code that's using CMFFormController.
In now way is this a bug in CMFFormController. At best it's a missing feature, and I'd argue it'd be a mis-feature.
I see you point, but I disagree, keep reading... ;-)
Rolling back the transaction seems drastic. In some cases, you may even want to save something even if validation fails.
If you need to save something even if the validation fails at a later point, you can do a full commit at anytime.
Doing a full premature commit is bad. Something later (outside the control of your cpy script) could fail, in which case you do want something rolled back.
You asked for a way to 'save something even if validation fails'. I presented that to you.
A premature commit is bad, but at least you have the choice to do it, and this choice is something that we don't have now for the 'abort' case.
I don't think it's hard. Let's say you set up a chain like this:
+---(success)-->[save script] --[page template]-->[validator]--+ +---(failure)-->[abort/error page]
The validator is in the chain explicitly. You may not know what in the validator exactly failed, but you *do* know that something failed, and you can react accordingly.
Of course I can do whatever I want in a custom content-type and/or plain form validation... but I'm talking about the *standard* behavior of the Archetypes/CMFFormController integration... and even further, the standard behavior of CMFFormController validation.
As Wichert and Sidnei pointed out, the default use case should be:
- abort any persistent change, and give the option to save something even if the validation fails
I did not point that out and I do not agree with that point of view. In my opinion a transaction should never be aborted unless a programmer very explicitly says so. A formcontroller path does not fall in that category in my opinion.
But the current default implementation can be read as:
- keep the persistent changes, and doesn't allow us to abort them if the validation fails... :-/
It does allow that. If you need to doom the transaction your verification script can do so.
In fact, it's much easier to fix it directly on Archetypes, but what I want to make sure people understand is that the current implementation assumes the wrong case as the default one.
I also don't think this should be changed in archetypes.
Wichert.
--
Wichert Akkerman <wich...@public.gmane.org> It is
simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/







