|
SimpleMapProcessor don't stop after the first error
--------------------------------------------------- Key: OFBIZ-3473 URL: https://issues.apache.org/jira/browse/OFBIZ-3473 Project: OFBiz Issue Type: Bug Components: framework Affects Versions: SVN trunk Reporter: Dimitri Unruh Attachments: SimpleMapProcess.patch Hi @all, the SimpleMapProcessor don't stop the validation for a given field after the first error. For example: I need to validate a birthdate from an input field. So I process two validation for the field: 1. isDate 2. isDateBeforeToday If the string is not a proper date, the process should stop here, because the secand validation would throw an exception. I modified this. Hopefully you like it :) Dimitri -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
[ https://issues.apache.org/jira/browse/OFBIZ-3473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dimitri Unruh updated OFBIZ-3473: --------------------------------- Attachment: SimpleMapProcess.patch > SimpleMapProcessor don't stop after the first error > --------------------------------------------------- > > Key: OFBIZ-3473 > URL: https://issues.apache.org/jira/browse/OFBIZ-3473 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Dimitri Unruh > Attachments: SimpleMapProcess.patch > > > Hi @all, > the SimpleMapProcessor don't stop the validation for a given field after the first error. > For example: > I need to validate a birthdate from an input field. So I process two validation for the field: > 1. isDate > 2. isDateBeforeToday > If the string is not a proper date, the process should stop here, because the secand validation would throw an exception. > I modified this. Hopefully you like it :) > Dimitri -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David E. Jones closed OFBIZ-3473. --------------------------------- Resolution: Not A Problem Fix Version/s: SVN trunk Assignee: David E. Jones The description isn't totally clear on the code that produced this behavior, but based on the description it sounds like this is what it should be doing. This patch should not be committed. If it was committed it would break and/or impede the function of existing code. The intent of simple-method validation is to allow for a set of validations to be done and then the result of all of them reported back to a user so that they don't get stuck in a frustrating loop of having to deal with one issue at a time (a real nightmare for large forms). In your simple-method you can quit any time with the check-errors operation. For more information about both of these parts of the simple-methods, please read the MiniLang Guide. > SimpleMapProcessor don't stop after the first error > --------------------------------------------------- > > Key: OFBIZ-3473 > URL: https://issues.apache.org/jira/browse/OFBIZ-3473 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Dimitri Unruh > Assignee: David E. Jones > Fix For: SVN trunk > > Attachments: SimpleMapProcess.patch > > > Hi @all, > the SimpleMapProcessor don't stop the validation for a given field after the first error. > For example: > I need to validate a birthdate from an input field. So I process two validation for the field: > 1. isDate > 2. isDateBeforeToday > If the string is not a proper date, the process should stop here, because the secand validation would throw an exception. > I modified this. Hopefully you like it :) > Dimitri -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832905#action_12832905 ] Dimitri Unruh commented on OFBIZ-3473: -------------------------------------- David, sorry, I don't agree with you. Maybe my description was not so clear, so I try it again: Have a look at the following example: <simple-map-processor name="newPerson"> <process field="USER_FIRST_NAME"> .... </process> <process field="..."> .... </process> <process field="birthDate "> <not-empty><fail-property .... /></not-empty> <validate-method method="isDate"><fail-property .../></validate-method> <validate-method method="isDateBeforeToday"><fail-property .../></validate-method> </process> <process field="..."> .... </process> </simple-map-processor> 1. case: we got an empty value for birthDate Message: "birthDate is a required field" 2. case: birthDate is 12/12/2020 Message: "birthDate is invalid because you are not M.J.Fox :)" 3. case: birthDate is "abc" Messages: "birthDate has a from format" and "birthDate is invalid because you are not M.J.Fox :)" And that's the pont: the second message is (in my optinion) a failure here. You talking about frustrating a user, I guess this one would let him stop the process (just look at some useability studies for ecommerce). We have to tell a user everytime what is going on and give him an exact message as a feedback to his input. I hope this makes my intention more clear, so I will reopen this issue. Dimitri > SimpleMapProcessor don't stop after the first error > --------------------------------------------------- > > Key: OFBIZ-3473 > URL: https://issues.apache.org/jira/browse/OFBIZ-3473 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Dimitri Unruh > Assignee: David E. Jones > Fix For: SVN trunk > > Attachments: SimpleMapProcess.patch > > > Hi @all, > the SimpleMapProcessor don't stop the validation for a given field after the first error. > For example: > I need to validate a birthdate from an input field. So I process two validation for the field: > 1. isDate > 2. isDateBeforeToday > If the string is not a proper date, the process should stop here, because the secand validation would throw an exception. > I modified this. Hopefully you like it :) > Dimitri -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dimitri Unruh reopened OFBIZ-3473: ---------------------------------- > SimpleMapProcessor don't stop after the first error > --------------------------------------------------- > > Key: OFBIZ-3473 > URL: https://issues.apache.org/jira/browse/OFBIZ-3473 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Dimitri Unruh > Assignee: David E. Jones > Fix For: SVN trunk > > Attachments: SimpleMapProcess.patch > > > Hi @all, > the SimpleMapProcessor don't stop the validation for a given field after the first error. > For example: > I need to validate a birthdate from an input field. So I process two validation for the field: > 1. isDate > 2. isDateBeforeToday > If the string is not a proper date, the process should stop here, because the secand validation would throw an exception. > I modified this. Hopefully you like it :) > Dimitri -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free forum by Nabble | Edit this page |
