OFBiz
  1. OFBiz
  2. OFBIZ-2959

Can not add "Question Options" within the Survey section of the Content application.

    Details

      Description

      When editing a question in Content --> Survey which has a "Selected Option" Question Type, the page does not allow for the creation of a Question Option.
      Live URL: https://demo.ofbiz.org/content/control/EditSurveyQuestions?surveyId=1002&surveyQuestionId=1033#edit

      A stack trace is shown:

      Method public java.io.StringWriter org.ofbiz.widget.html.HtmlFormWrapper.renderFormString() throws java.io.IOException threw an exception when invoked on org.ofbiz.widget.html.HtmlFormWrapper@1f304b8 with arguments of types [] The problematic instruction: ---------- ==> $

      {createSurveyOptionWrapper.renderFormString()}

      [on line 306, column 5 in component://content/webapp/content/survey/EditSurveyQuestions.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public java.io.StringWriter org.ofbiz.widget.html.HtmlFormWrapper.renderFormString() throws java.io.IOException threw an exception when invoked on org.ofbiz.widget.html.HtmlFormWrapper@1f304b8 with arguments of types [] at freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:134) at fr
      ...

      Caused by: java.lang.NullPointerException at org.ofbiz.widget.form.ModelFormField$EntityOptions.addOptionValues(ModelFormField.java:1722) at org.ofbiz.widget.form.ModelFormField$FieldInfoWithOptions.getAllOptionValues(ModelFormField.java:1526) at org.ofbiz.widget.html.HtmlFormRenderer.renderDropDownField(HtmlFormRenderer.java:697

      1. screen-solution.GIF
        47 kB
        Sumit Pandit
      2. screen-error.GIF
        58 kB
        Sumit Pandit
      3. OFBIZ-2959.patch
        1 kB
        Harsha Chadhar

        Issue Links

          Activity

          Brant Levinson created issue -
          Gavin made changes -
          Field Original Value New Value
          Workflow jira [ 12477447 ] OFbiz Workflow [ 12503866 ]
          Hide
          Tom Burns added a comment -

          Hi All!

          Ran into this old issue when trying to create a Survey.

          This last worked in branch release 4.0 where "HtmlFormWrapper createSurveyOptionWrapper = new HtmlFormWrapper ..." was implemented in EditSurveyQuestions.bsh. Since then it is implemented in EditSurveyQuestions.groovy.

          This feature supports a critical question type used in most Surveys.

          Any old hands out there that can fix this in a reasonable amount of time (reasonable being something less by an order of magnitude that it would take me to fix (est. to be kind 5+ hours)

          Thanks for any help.

          Tom

          Show
          Tom Burns added a comment - Hi All! Ran into this old issue when trying to create a Survey. This last worked in branch release 4.0 where "HtmlFormWrapper createSurveyOptionWrapper = new HtmlFormWrapper ..." was implemented in EditSurveyQuestions.bsh. Since then it is implemented in EditSurveyQuestions.groovy. This feature supports a critical question type used in most Surveys. Any old hands out there that can fix this in a reasonable amount of time (reasonable being something less by an order of magnitude that it would take me to fix (est. to be kind 5+ hours) Thanks for any help. Tom
          Harsha Chadhar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Harsha Chadhar added a comment -

          Identified that the delegator's object is missing in context while displaying form CreateSurveyQuestionOption, hence a proposed solution is to set delegator object in context in HtmlFormWrapper's constructor. Please refer the patch.

          Show
          Harsha Chadhar added a comment - Identified that the delegator's object is missing in context while displaying form CreateSurveyQuestionOption, hence a proposed solution is to set delegator object in context in HtmlFormWrapper's constructor. Please refer the patch.
          Harsha Chadhar made changes -
          Attachment OFBIZ-2959.patch [ 12525825 ]
          Hide
          Jacques Le Roux added a comment -

          Could someone please test?

          Show
          Jacques Le Roux added a comment - Could someone please test?
          Harsha Chadhar made changes -
          Link This issue blocks OFBIZ-4879 [ OFBIZ-4879 ]
          Harsha Chadhar made changes -
          Link This issue blocks OFBIZ-4878 [ OFBIZ-4878 ]
          Hide
          Sumit Pandit added a comment -

          Hello Jacques,

          I tested and it is working fine. Please find two screenshots for reference : screen-error.GIF(represent error screen) and screen-solution.GIF (after applying patch).

          It can be reproduced in following steps -
          1) Go to : https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000
          OR
          https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000&surveyQuestionId=10000&surveyQuestionCategoryId=1000#edit
          2) Create New Question with "Survey Question Type Id" = "Selected Option"
          3) ERROR Screen : screen-error.GIF
          4) Question starts appearing in list.
          5) Page rendering exception is coming in create question option section.
          6) Apply patch and observe screen : screen-solution.GIF

          Show
          Sumit Pandit added a comment - Hello Jacques, I tested and it is working fine. Please find two screenshots for reference : screen-error.GIF(represent error screen) and screen-solution.GIF (after applying patch). It can be reproduced in following steps - 1) Go to : https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000 OR https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000&surveyQuestionId=10000&surveyQuestionCategoryId=1000#edit 2) Create New Question with "Survey Question Type Id" = "Selected Option" 3) ERROR Screen : screen-error.GIF 4) Question starts appearing in list. 5) Page rendering exception is coming in create question option section. 6) Apply patch and observe screen : screen-solution.GIF
          Hide
          Sumit Pandit added a comment -


          Thanks And Regards
          Sumit Pandit

          Show
          Sumit Pandit added a comment - – Thanks And Regards Sumit Pandit
          Sumit Pandit made changes -
          Attachment screen-error.GIF [ 12527808 ]
          Attachment screen-solution.GIF [ 12527809 ]
          Hide
          Jacques Le Roux added a comment -

          Thanks Harsha and Sumit,

          Harsha your patch is in
          trunk r1340357
          R12.04 r1340358
          R11.04 r1340359
          R10.04 r1340360
          R09.04 simle GenericDelegator vs Delegator conflicts, I gave up

          Great collaboration

          Show
          Jacques Le Roux added a comment - Thanks Harsha and Sumit, Harsha your patch is in trunk r1340357 R12.04 r1340358 R11.04 r1340359 R10.04 r1340360 R09.04 simle GenericDelegator vs Delegator conflicts, I gave up Great collaboration
          Jacques Le Roux made changes -
          Status Patch Available [ 10002 ] Closed [ 6 ]
          Assignee Jacques Le Roux [ jacques.le.roux ]
          Fix Version/s Release Branch 10.04 [ 12314832 ]
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Fix Version/s SVN trunk [ 12311928 ]
          Fix Version/s Release Branch 12.04 [ 12321265 ]
          Resolution Fixed [ 1 ]
          Hide
          Harsha Chadhar added a comment -

          Thanks Jacques & Sumit.
          Please also have a look at issues OFBIZ-4878 and OFBIZ-4879 as well, these were dependent on resolution of this issue.

          Show
          Harsha Chadhar added a comment - Thanks Jacques & Sumit. Please also have a look at issues OFBIZ-4878 and OFBIZ-4879 as well, these were dependent on resolution of this issue.
          Gavin made changes -
          Link This issue blocks OFBIZ-4879 [ OFBIZ-4879 ]
          Gavin made changes -
          Link This issue is depended upon by OFBIZ-4879 [ OFBIZ-4879 ]
          Gavin made changes -
          Link This issue blocks OFBIZ-4878 [ OFBIZ-4878 ]
          Gavin made changes -
          Link This issue is depended upon by OFBIZ-4878 [ OFBIZ-4878 ]

            People

            • Assignee:
              Jacques Le Roux
              Reporter:
              Brant Levinson
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development