Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6643

Order items for GZ-1006-5 via ecommerce/ordermgr shows error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: order
    • Labels:
    • Sprint:
      Community Day 3 - 2015

      Description

      When an order is entered via the ecommerce component for a GZ-1006-5 an error is shown in the order items section. See error below.

       GZ-2644 - Round Gizmo
      FreeMarker template error: Java method "org.ofbiz.entity.GenericDelegator.findByAnd(String, Map, List, boolean)" takes 4 arguments, but 2 was given. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign downloadContents = delegator... [in template "component://order/webapp/ordermgr/order/orderitems.ftl" at line 84, column 41] ---- Java stack trace (for programmers): ---- freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...] at freemarker.ext.beans.SimpleMethod.unwrapArguments(SimpleMethod.java:67) at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:72) at freemarker.core.MethodCall._eval(MethodCall.java:62) at freemarker.core.Expression.eval(Expression.java:78) at freemarker.core.Assignment.accept(Assignment.java:70) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.MixedContent.accept(MixedContent.java:62) at freemarker.core.Environment.visitByHiddingParent(Environment.java:333) at freemarker.core.IfBlock.accept(IfBlock.java:48) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.MixedContent.accept(MixedContent.java:62) at freemarker.core.Environment.visitByHiddingParent(Environment.java:333) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:148) at freemarker.core.Environment.visitIteratorBlock(Environment.java:559) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:67) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.MixedContent.accept(MixedContent.java:62) at freemarker.core.Environment.visitByHiddingParent(Environment.java:333) at freemarker.core.IfBlock.accept(IfBlock.java:48) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.MixedContent.accept(MixedContent.java:62) at freemarker.core.Environment.visitByHiddingParent(Environment.java:333) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.MixedContent.accept(MixedContent.java:62) at freemarker.core.Environment.visit(Environment.java:312) at freemarker.core.Environment.process(Environment.java:290) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:257) at org.ofbiz.widget.model.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:167) at org.ofbiz.widget.model.HtmlWidget$HtmlTemplate.renderWidgetString(HtmlWidget.java:216) at org.ofbiz.widget.model.HtmlWidget.renderWidgetString(HtmlWidget.java:140) at org.ofbiz.widget.model.ModelScreenWidget$PlatformSpecific.renderWidgetString(ModelScreenWidget.java:1319) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:906) at org.ofbiz.widget.model.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:127) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:943) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:906) at org.ofbiz.widget.model.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:127) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:943) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:459) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:459) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:459) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.ofbiz.widget.model.ScreenFactory.renderReferencedScreen(ScreenFactory.java:211) at org.ofbiz.widget.model.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:780) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.ofbiz.widget.model.ScreenFactory.renderReferencedScreen(ScreenFactory.java:211) at org.ofbiz.widget.model.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:780) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.ofbiz.widget.model.ScreenFactory.renderReferencedScreen(ScreenFactory.java:211) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:860) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.ofbiz.widget.model.ScreenFactory.renderReferencedScreen(ScreenFactory.java:211) at org.ofbiz.widget.model.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:860) at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.ofbiz.widget.renderer.ScreenRenderer.render(ScreenRenderer.java:136) at org.ofbiz.widget.renderer.ScreenRenderer.render(ScreenRenderer.java:98) at org.ofbiz.widget.renderer.macro.MacroScreenViewHandler.render(MacroScreenViewHandler.java:157) at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:991) at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:675) at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:213) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:324) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
      

        Issue Links

          Activity

          Hide
          vyom0213@gmail.com Vyom Jain added a comment -

          This is happening due to changes OFBIZ-6276. Either r1704108 (the commit message refers to OFBIZ-5361, which is incorrect) should be reverted or additional patches be provided to avoid this reported issue (which is only one of them).
          Removing deprecated delegator methods require thorough testing as many as used in scripts and templates.

          Show
          vyom0213@gmail.com Vyom Jain added a comment - This is happening due to changes OFBIZ-6276 . Either r1704108 (the commit message refers to OFBIZ-5361 , which is incorrect) should be reverted or additional patches be provided to avoid this reported issue (which is only one of them). Removing deprecated delegator methods require thorough testing as many as used in scripts and templates.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks Vyom, I just fixed the commit log. I will double-check that...

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks Vyom, I just fixed the commit log. I will double-check that...
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Pierre

          I wonder about this issue, because I can't reproduce it on trunk demo, nor locally. Also the line 84 of applications/order/webapp/ordermgr/order/orderitems.ftl is

          <#assign downloadContents = delegator.findByAnd("OrderItemAndProductContentInfo", {"orderId" : orderId, "orderItemSeqId" : orderItem.orderItemSeqId, "productContentTypeId" : "DIGITAL_DOWNLOAD", "statusId" : "ITEM_COMPLETED"})/>
          

          so obviously contains 4 parameters not 2. It's maybe related with the way you checked out, I used ther quick checkout, but I can't see how it could be related. Please give me the steps you used.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Pierre I wonder about this issue, because I can't reproduce it on trunk demo, nor locally. Also the line 84 of applications/order/webapp/ordermgr/order/orderitems.ftl is <#assign downloadContents = delegator.findByAnd( "OrderItemAndProductContentInfo" , { "orderId" : orderId, "orderItemSeqId" : orderItem.orderItemSeqId, "productContentTypeId" : "DIGITAL_DOWNLOAD" , "statusId" : "ITEM_COMPLETED" })/> so obviously contains 4 parameters not 2. It's maybe related with the way you checked out, I used ther quick checkout, but I can't see how it could be related. Please give me the steps you used.
          Hide
          pfm.smits Pierre Smits added a comment -

          What I noticed when doing a normal checkout of the Round Gizmo was that GZ-1006-5 - Open Gizmo (ASL2) was added to the Final Checkout Review.

          Maybe that is the culprit.

          Show
          pfm.smits Pierre Smits added a comment - What I noticed when doing a normal checkout of the Round Gizmo was that GZ-1006-5 - Open Gizmo (ASL2) was added to the Final Checkout Review. Maybe that is the culprit.
          Hide
          pfm.smits Pierre Smits added a comment -

          Having tested adding a single GZ-1006-5 to a new order in ordermgr, delivers the error when the order is finalised.

          Will change the title and description accordingly.

          Show
          pfm.smits Pierre Smits added a comment - Having tested adding a single GZ-1006-5 to a new order in ordermgr, delivers the error when the order is finalised. Will change the title and description accordingly.
          Hide
          pfm.smits Pierre Smits added a comment -

          This patch addresses the issue.

          Show
          pfm.smits Pierre Smits added a comment - This patch addresses the issue.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Obviously your patch is good and it works. Just that when I add the GZ-1006-5, even before your patch, I get to a blank page. You can check on trunk demo. Did yo not get that?

          Also Vyom was right, there are other cases to fix in FTL files where not 4 parameters are passed, at least I found among the 40 cases:

          <#assign quoteTerms = delegator.findByAnd("QuoteTerm", {"quoteId" : quoteItem.quoteId, "quoteItemSeqId" : quoteItem.quoteItemSeqId})>
          <#assign userLoginApprovers  = delegator.findByAnd("UserLogin",Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", partyRole.partyId))/>
          <#assign partyContentDetail  = delegator.findByAnd("ContentApproval",Static["org.ofbiz.base.util.UtilMisc"].toMap("roleTypeId", "IMAGEAPPROVER", "approvalStatusId", "IM_PENDING", "partyId", userLoginAndPartyDetails.partyId))/>
          

          Grrovy files seems all good. Could you please double check before I enhance and apply your patch (a new patch is welcome ), thanks!

          Show
          jacques.le.roux Jacques Le Roux added a comment - Obviously your patch is good and it works. Just that when I add the GZ-1006-5, even before your patch, I get to a blank page. You can check on trunk demo. Did yo not get that? Also Vyom was right, there are other cases to fix in FTL files where not 4 parameters are passed, at least I found among the 40 cases: <#assign quoteTerms = delegator.findByAnd( "QuoteTerm" , { "quoteId" : quoteItem.quoteId, "quoteItemSeqId" : quoteItem.quoteItemSeqId})> <#assign userLoginApprovers = delegator.findByAnd( "UserLogin" ,Static[ "org.ofbiz.base.util.UtilMisc" ].toMap( "partyId" , partyRole.partyId))/> <#assign partyContentDetail = delegator.findByAnd( "ContentApproval" ,Static[ "org.ofbiz.base.util.UtilMisc" ].toMap( "roleTypeId" , "IMAGEAPPROVER" , "approvalStatusId" , "IM_PENDING" , "partyId" , userLoginAndPartyDetails.partyId))/> Grrovy files seems all good. Could you please double check before I enhance and apply your patch (a new patch is welcome ), thanks!
          Hide
          pfm.smits Pierre Smits added a comment -

          Jacques Le Roux] I tested it against demo-trunk (see http://demo-trunk-ofbiz.apache.org/ordermgr/control/orderview?orderId=WSCO10002 of today) and get the same result. Are you sure you did not test against another version?

          Show
          pfm.smits Pierre Smits added a comment - Jacques Le Roux ] I tested it against demo-trunk (see http://demo-trunk-ofbiz.apache.org/ordermgr/control/orderview?orderId=WSCO10002 of today) and get the same result. Are you sure you did not test against another version?
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks Pierre,

          Your enhanced patch is committed in trunk at revision: 1704478

          Actually, as Vyom Jain suggested

          This is happening due to changes OFBIZ-6276. Either r1704108 should be reverted or additional patches be provided to avoid this reported issue (which is only one of them). Removing deprecated delegator methods require thorough testing as many as used in scripts and templates.

          I checked there was only 3 such changes for findByAnd and no others but getRelated where called in *.ftl and *.groovy. This completes the findByAnd case I will create a new Jira for getRelated (did not check already, 238 cases!)

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks Pierre, Your enhanced patch is committed in trunk at revision: 1704478 Actually, as Vyom Jain suggested This is happening due to changes OFBIZ-6276 . Either r1704108 should be reverted or additional patches be provided to avoid this reported issue (which is only one of them). Removing deprecated delegator methods require thorough testing as many as used in scripts and templates. I checked there was only 3 such changes for findByAnd and no others but getRelated where called in *.ftl and *.groovy. This completes the findByAnd case I will create a new Jira for getRelated (did not check already, 238 cases!)
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I will create an issue for the blank page we get when ordering an open-gismo-GZ-1006-p. This issue is unrelated to the current issue but is also a regression: does not exist in stable

          Show
          jacques.le.roux Jacques Le Roux added a comment - I will create an issue for the blank page we get when ordering an open-gismo-GZ-1006-p. This issue is unrelated to the current issue but is also a regression: does not exist in stable
          Hide
          jacques.le.roux Jacques Le Roux added a comment -
          Show
          jacques.le.roux Jacques Le Roux added a comment - OFBIZ-6650
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I created OFBIZ-6650 for that

          Show
          jacques.le.roux Jacques Le Roux added a comment - I created OFBIZ-6650 for that

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              pfm.smits Pierre Smits
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile