[
https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515491
]
Wickersheimer Jeremy commented on OFBIZ-1172:
---------------------------------------------
I give you the step to reproduce on a base ofbiz install with demo data:
- into Content / websites, edit OrderEntry website
( https://localhost:8443/content/control/EditWebSite?webSiteId=OrderEntry )
- Set Product Store Id to "empty", then update
- go to orderentry, and try to make a purchase order
You get :
The Following Errors Occurred:
Error calling event: org.ofbiz.webapp.event.EventHandlerException: Problems
processing event: java.lang.NullPointerException (null)
The Code expects to have a ProductStore entity, and it is taken from the
request either the WebSite or the Cart entities. The WebSite is set to
OrderEntry website, and since we set the Product Store Id to null, it chokes.
The ProductStore entity is required to get the defaultCurrency, the Locale, ...
The code to get the store locale handles null ProductStore (there is a test and
logError if not ProductStore), the currency doesn't have such there is a NPE
when it calls the method getCurrency (or such).
I first patched this to add a check but then it would NPE a somewhere else so a
ProductStore IS required to make a PO.
I did not get the exact business logic of why is a ProductStore needed ...
maybe it makes sense. But that is not the point, the error message was just
very unhelpful.
> Order Entry unclear error when no ProductStore set
> --------------------------------------------------
>
> Key: OFBIZ-1172
> URL: https://issues.apache.org/jira/browse/OFBIZ-1172
> Project: OFBiz
> Issue Type: Improvement
> Components: order
> Affects Versions: SVN trunk, Release Branch 4.0
> Reporter: Wickersheimer Jeremy
> Priority: Minor
> Attachments: ofbiz-1172.patch
>
>
> I ran into this issue because our staff accidentally removed the ProductStore
> from the OrderEntry Website. The symptom was an java NPE display when trying
> to create a Purchase Order.
> Because it took me some time to debug it i wrote a patch to make this
> behavior more obvious.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.