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

add gift certificate in purchase order cause exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.04
    • Component/s: order
    • Labels:
      None

      Description

      Go to https://localhost:8443/ordermgr/control/orderentry
      open new purchase order
      fill info
      click 'continue'
      fill info
      click on 'continue'
      click 'Add Gift Certificate'

      message...
      ERROR rendering error page [/error/error.jsp], but here is the error text: org.apache.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen component://order/widget/ordermgr/OrderEntryCartScreens.xml#AddGiftCertificate: java.lang.IllegalArgumentException: Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object (Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object)

      console output...
      2017-06-28 15:39:45,497 |jsse-nio-8443-exec-4 |ScriptUtil |W| Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object
      java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object
      at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) ~[groovy-all-2.4.12.jar:2.4.12]
      at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174) ~[groovy-all-2.4.12.jar:2.4.12]
      ...
      2017-06-28 15:39:45,501 |jsse-nio-8443-exec-4 |ModelScreen |E| Error rendering screen component://order/widget/ordermgr/OrderEntryCartScreens.xml#AddGiftCertificate: java.lang.IllegalArgumentException: Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object. Rolling back transaction.
      2017-06-28 15:39:45,503 |jsse-nio-8443-exec-4 |TransactionUtil |I| Transaction rolled back
      2017-06-28 15:39:45,503 |jsse-nio-8443-exec-4 |ControlServlet |E| Error in request handler:
      org.apache.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen component://order/widget/ordermgr/OrderEntryCartScreens.xml#AddGiftCertificate: java.lang.IllegalArgumentException: Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object (Error running script at location [component://order/groovyScripts/entry/AddGiftCertificates.groovy]: java.lang.NullPointerException: Cannot get property 'purchaseSurveyId' on null object)
      at org.apache.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:179) ~[ofbiz.jar:?]
      ...

      1. OFBIZ-9438.patch
        0.7 kB
        Pallavi Goyal

        Activity

        Hide
        wt Wai added a comment -

        when creating a purchase order, there are no gift cards. Hence the exception order/groovyScripts/entry/AddGiftCertificates.groovy
        The solution is to hide the "Add Gift Certificate" button for purchase orders.

        Show
        wt Wai added a comment - when creating a purchase order, there are no gift cards. Hence the exception order/groovyScripts/entry/AddGiftCertificates.groovy The solution is to hide the "Add Gift Certificate" button for purchase orders.
        Hide
        pallavi.goyal Pallavi Goyal added a comment -

        Here is the patch for fixing the exception when the button [ Add Gift Certificate ] is clicked.

        For now, the exception is fixed. It can be discussed whether to show or hide the button [ Add Gift Certificate ] on 'Create Purchase order' screen.

        Show
        pallavi.goyal Pallavi Goyal added a comment - Here is the patch for fixing the exception when the button [ Add Gift Certificate ] is clicked. For now, the exception is fixed. It can be discussed whether to show or hide the button [ Add Gift Certificate ] on 'Create Purchase order' screen.
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Wai and Pallavi for your contribution

        Applied slightly modified patch and added condition to show git card only for Sales order
        This has been fixed at
        ofbiz framework trunk at r#1801274
        R16.11 at r#1801275

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Wai and Pallavi for your contribution Applied slightly modified patch and added condition to show git card only for Sales order This has been fixed at ofbiz framework trunk at r#1801274 R16.11 at r#1801275

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            wt Wai
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development