You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Guido Amarilla (JIRA)" <ji...@apache.org> on 2007/01/02 10:27:27 UTC
[jira] Commented: (OFBIZ-430) Incorrect Product Supplier update and
delete in some locales
[ http://issues.apache.org/jira/browse/OFBIZ-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461698 ]
Guido Amarilla commented on OFBIZ-430:
--------------------------------------
Just to learn how to debug OFBiz I tried to find where this issue is originated.
So I am posting what I found. Excuse me if I am not clear or if writing something very obvious.
In ModelScreenAction$SetField.runAction(Map) line: 167
if (!this.fromField.isEmpty()) {
newValue = this.fromField.get(context);
Gets minimumOrderQuantity from context using current Locale.
In case of Spanish a comma ( , ) is used as decimal separator symbol.
This is an example Parameters section of context used for testing:
==>[parameters]:[currencyUomId=ARS, productId=R110_14_1, minimumOrderQuantity=10.0, partyId=10003, availableFromDate=2006-05-13 22:24:13.0,................
You can see that the decimal separator is a point ( . )
So newValue gets the string "10.0"
later in ModelScreenAction$SetField.runAction(Map) line: 182
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, locale);
newValue gets "100" because "10.0" is converted using the comma as decimal symbol and it is ignored.
Then context is filled with these values:
============================== Start stack level 0
==>[formStringRenderer]:org.ofbiz.widget.html.HtmlFormRenderer@7efdd5
==>[null]:[null-field]
==>[titleProperty]:PageTitleEditSupplierProduct
==>[tabButtonItem]:EditSupplierProduct
==>[labelTitleProperty]:ProductSuppliers
==>[defaultCurrencyUomId]:ARS
==>[productId]:R110_14_1
==>[minimumOrderQuantity]:100.0 <<<<<<<<<<<<----- ERROR!
============================== End stack level 0
:
My question is if we change this line from ModelScreenAction$SetField.runAction:
Locale locale = UtilMisc.ensureLocale(context.get("locale"));
to "en-US" Locale
Could it break other services?
Stack:
Thread [http-0.0.0.0-8443-Processor3] (Suspended)
ModelScreenAction$SetField.runAction(Map) line: 169
ModelScreenAction.runSubActions(List, Map) line: 113
ModelScreenWidget$Section.renderWidgetString(Writer, Map, ScreenStringRenderer) line: 235
ModelScreen.renderScreenString(Writer, Map, ScreenStringRenderer) line: 131
ScreenRenderer.render(String, String) line: 102
ScreenRenderer.render(String) line: 87
ScreenWidgetViewHandler.render(String, String, String, String, String, HttpServletRequest, HttpServletResponse) line: 75
RequestHandler.renderView(String, boolean, HttpServletRequest, HttpServletResponse) line: 602
RequestHandler.doRequest(HttpServletRequest, HttpServletResponse, String, GenericValue, GenericDelegator) line: 387
ControlServlet.doGet(HttpServletRequest, HttpServletResponse) line: 178
ControlServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 595
ControlServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 688
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 252
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
ContextFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 245
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 202
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
StandardWrapperValve.invoke(Request, Response) line: 213
StandardContextValve.invoke(Request, Response) line: 178
StandardHostValve.invoke(Request, Response) line: 126
ErrorReportValve.invoke(Request, Response) line: 105
StandardEngineValve.invoke(Request, Response) line: 107
AccessLogValve.invoke(Request, Response) line: 541
CoyoteAdapter.service(Request, Response) line: 148
Http11Processor.process(InputStream, OutputStream) line: 869
Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection, Object[]) line: 664
PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527
LeaderFollowerWorkerThread.runIt(Object[]) line: 80
ThreadPool$ControlRunnable.run() line: 684
ThreadWithAttributes(Thread).run() line: 595
context Map:
============================== Start stack level 0
==>[bshInterpreter]:bsh.Interpreter@a7d8b0
============================== End stack level 0
============================== Start stack level 1
==>[screens]:org.ofbiz.widget.screen.ScreenRenderer@1f66272
============================== End stack level 1
============================== Start stack level 2
==>[formStringRenderer]:org.ofbiz.widget.html.HtmlFormRenderer@b942f7
==>[null]:[null-field]
==>[titleProperty]:PageTitleEditSupplierProduct
==>[tabButtonItem]:EditSupplierProduct
==>[labelTitleProperty]:ProductSuppliers
==>[defaultCurrencyUomId]:ARS
==>[productId]:R110_14_1
==>[minimumOrderQuantity]:100.0
==>[orderBy]:partyId
==>[product]:[GenericEntity:Product][amountUomTypeId,null()][autoCreateKeywords,null()][billOfMaterialLevel,0(java.lang.Long)][brandName,null()][chargeShipping,null()][comments,null()][createdByUserLogin,gamarilla(java.lang.String)][createdDate,2006-05-14
> Incorrect Product Supplier update and delete in some locales
> ------------------------------------------------------------
>
> Key: OFBIZ-430
> URL: http://issues.apache.org/jira/browse/OFBIZ-430
> Project: Apache OFBiz (The Open for Business Project)
> Issue Type: Bug
> Components: product
> Affects Versions: SVN trunk
> Reporter: Guido Amarilla
> Assigned To: Jacopo Cappellato
> Priority: Minor
>
> It is an issue with product suppliers.
> When trying to modify a supplier product by clicking in the "Update"
> button next to each row, it doesn´t get all the supplier´s product
> information, and Minimum Order Quantity is being multiplied by 10.
> * This happens in several languages, but not in english nor french.
> Another problem is that it isn't possible to delete a row, in any of the affected locales, giving the following error:
> *In remove-value a value was not found with the specified valueAcsr: sprod, not removing
> This was confirmed by Jacopo Cappellato who says that it is related to the way
> numbers are parsed according to the locale.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira