[ 
https://issues.apache.org/jira/browse/OFBIZ-10120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16306075#comment-16306075
 ] 

Yogesh Naroliya commented on OFBIZ-10120:
-----------------------------------------

This issue introduced due changes done at *revision 1817641*. When we are 
trying to remove the selected item from the cart, modifyCart() method of 
ShoppingCartHelper is called which iterates the contextMap in it. Lets consider 
we have following cotextMap:

{code}
{GWALL=, selectAll=0, price_0=38.40, removeSelected=true, shipAfterDate_0=, 
shipBeforeDate_0=, selectedItem=0, description_0=Round Gizmo, 
shipAfterDate_0_i18n=, shipBeforeDate_0_i18n=, update_0=1}
{code}

Then according to current implementation the value of *quantString* is setting 
as the *keyName(parameterName)* of contextMap. Then in iteration it takes 
*price_0* as the quantString and tries to convert it into *BigDecimal* on 
following line:

{code}
quantity = (BigDecimal) ObjectType.simpleTypeConvert(quantString, "BigDecimal", 
null, locale);
{code}

Which throws an exception which is caught by the following catch block:

{code}
catch (GeneralException e) {
    Debug.logWarning(e, UtilProperties.getMessage(resource_error, 
"OrderCaughtExceptionOnCartUpdate", cart.getLocale()));
}
{code}

but in further iteration it takes *shipAfterDate_0* as quantString and tries to 
convert it into *TimeStamp* on following line:

{code}
item.setShipBeforeDate(Timestamp.valueOf(quantString));
{code}

which is not further handled and throws the reported error on the screen:

{code}
The Following Errors Occurred:
Error calling event: org.apache.ofbiz.webapp.event.EventHandlerException: 
Problems processing event: java.lang.IllegalArgumentException: Timestamp format 
must be yyyy-mm-dd hh:mm:ss[.fffffffff] (Timestamp format must be yyyy-mm-dd 
hh:mm:ss[.fffffffff])
{code}

Apart from this previously we were setting the value of *qunatString* as the 
keyValue of contextMap, so I have corrected it to read *keyValue* instead of 
overriding it with *keyName* . 

> Unable to remove selected item from cart
> ----------------------------------------
>
>                 Key: OFBIZ-10120
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10120
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Trunk
>            Reporter: Yogesh Naroliya
>            Assignee: Rishi Solanki
>         Attachments: OFBIZ-10120.patch, RemoveSelectedItemIssue.png
>
>
> *Steps to Regenerate:*
> 1. Open https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderentry
> 2. Press continue on sales order screen.
> 3. Add a finished good item to the sales order.
> 4. Select added item.
> 5. Click on *Remove Selected* button. 
> *Actual:*
> It is throwing following error:
> {code}
> The Following Errors Occurred:
> Error calling event: org.apache.ofbiz.webapp.event.EventHandlerException: 
> Problems processing event: java.lang.IllegalArgumentException: Timestamp 
> format must be yyyy-mm-dd hh:mm:ss[.fffffffff] (Timestamp format must be 
> yyyy-mm-dd hh:mm:ss[.fffffffff])
> {code}
> Note: Screenshot attached for reference.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to