Details
Description
Flow:
1. Create Sales Order with default option (store - OFBiz - Ecommerce store; No channel; user login ID: admin)
2. Continue with default option of Currency, Agreements, and Ship Dates.
3. Select product for this order (Ex: Forklift - Propane)
4. Click add to order
--> Error:
Forklift - Propane Powered.
FORKLIFT_PROPANE
Your Price: $0.00
Maximum Expression product.reservMaxPersons is undefined on line 364, column 190 in component://order/webapp/ordermgr/entry/catalog/productdetail.ftl. The problematic instruction: ---------- ==> ${product.reservMaxPersons} [on line 364, column 188 in component://order/webapp/ordermgr/entry/catalog/productdetail.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression product.reservMaxPersons is undefined on line 364, column 190 in component://order/webapp/ordermgr/entry/catalog/productdetail.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) at freemarker.core.Expression.getStringValue(Expression.java:118) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.Environment.process(Environment.java:199) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:251) at org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:224) at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString(HtmlWidget.java:269) at org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:129) at org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString(ModelScreenWidget.java:988) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) at org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:596) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:696) at org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:127) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:729) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:696) at org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:127) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:729) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:203) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:331) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) at org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:596) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) at org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:596) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:663) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:663) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:102) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:189) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:135) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:97) at org.ofbiz.widget.screen.MacroScreenViewHandler.render(MacroScreenViewHandler.java:111) at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:987) at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:668) at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:219) at org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:327) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) persons.
- This is link to this issue: https://backend.ofbizdemo.com/ordermgr/control/additem;jsessionid=3A7213F28AAAA40997B05C175394F96C.jvm1
Thanks for report Thang,
This is quite an old bug that I already fixed in ecommerce side at http://svn.apache.org/viewvc?view=revision&revision=745101
It has been reported for order manager here http://markmail.org/message/vcuypwuh4szmpq3f
It's an easy fix, but actually we rather face a data error. For a "Forklift - Propane" these Product entity fields
have not been set in demo data. They should obviously be
reservMaxPersons =1
reserv2ndPPPerc=0
reservNthPPPerc=0
It's possible to set them at catalog/control/EditProductAssetUsage?productId=FORKLIFT_PROPANE with fields
"Max.Nbr. of Persons for rental"
"Second person add.price percentage"
"Nth person add.price percentage"
Thenn the problem vanishes.
What I will do: change the default I used in ecommerce to set the values above and use the same in order manager. The logic behind being that these values should be set in data. But if people forgot them then it's because they did not make sense to them and the best default values are those above.
What we should do for demo data: add these default values to these products
For instance:
Now I wonder, because doing so you get to a screen where you still need to define a number of persons and rooms which does not make much sense to me (any for rooms). So it could be that the UI should be reviewed as well in relation with the data model to distinguish different types of rented products. Obvisouly when I want to sell or rent/buy a FORKLIFT_BATTERY there can't be a relation with a room... I feel something has beeen hastily dumped (or not envisionned) here and it will more work now to fix it, both at the data model and UI levels...
So for now I keep this issue open, not even resolved, it needs more thoughts...
I committed a temporary fix at r1577855 in trunk (only, will see later after discussion for releases)