You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Stephen Rufle (JIRA)" <ji...@apache.org> on 2011/02/08 13:15:57 UTC

[jira] Updated: (OFBIZ-4171) Blank year in UtilValidate.isYear should return false

     [ https://issues.apache.org/jira/browse/OFBIZ-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Rufle updated OFBIZ-4171:
---------------------------------

    Attachment: OFBIZ-4171.patch

Changes UtilValidate isYear, isMonth, and isDay to return false when a blank value is entered.


> Blank year in UtilValidate.isYear should return false
> -----------------------------------------------------
>
>                 Key: OFBIZ-4171
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4171
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, SVN trunk
>         Environment: Win XP
>            Reporter: Stephen Rufle
>            Priority: Minor
>         Attachments: OFBIZ-4171.patch
>
>
> UtilValidate.isYear returns true for a blank year which the calling function UtilValidate.isDate(String, String, String) tries to parse. This causes an exception to be thrown
> ValidateMethod.java:96 :ERROR] [ValidateMethod.exec] Error in validation method isDateAfterToday of class org.ofbiz.base.util.UtilValidate: null
> I found this error when trying to add a new credit card in the eCommerce checkout flow.
> # Add a product to the cart
> # login as any user I used "admin"
> # Checkout Step "Shipping Address" (Step 1: Where shall we ship it?)
> #* Click Next 
> # Checkout Step "Shipping Options" (Step 2: How shall we ship it?)
> #* Choose "UPS Air"
> #* Click Next 
> # Checkout Step "Payment Options" (Step 3: How shall you pay?)
> # Create "Credit Card"
> #* Fill Name
> #* Card Type "Visa"
> #* Card Number "4111111111111111"
> #* Expiration Date Month drop-down 01
> #* Expiration Date Year drop-down leave blank
> #* Choose billing address
> #* Click "Save" button
> Should see "Error in validation method isDateAfterToday of class org.ofbiz.base.util.UtilValidate: null" 
> My fix is to change isYear, isMonth, and isDay to return false when a blank value is entered.
> After I make my change the message is "The expiration date is before today"

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira