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

Setting a dependent question for question of type 'Boolean Yes/No' is not possible

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 11.04, Release Branch 12.04, Release Branch 13.07, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02
    • Component/s: content
    • Labels:
      None

      Description

      When having question 1 of type 'Boolean Yes/No' a second question being dependent on one of either options can not be set to be dependent on question 1.

      This is due to the fact that the select options Yes and No don't have an option value assigned. See code exerpt from html source below:

      <div>Did you enjoy the show?</div>
      </td>
      <td width="1">&nbsp;</td>
      <td align="right">
      <select name="answers_10020">
        <option value=""></option>
        <option selected="selected">Y</option>
        <option >N</option>
      </select>
      

        Activity

        Hide
        pfm.smits Pierre Smits added a comment -

        The Following Errors Occurred:

        Exception thrown while storing entity value: org.ofbiz.entity.GenericEntityException: Error while updating: [GenericEntity:SurveyQuestionAppl][createdStamp,2014-07-15 22:27:47.494(java.sql.Timestamp)][createdTxStamp,2014-07-15 22:27:47.406(java.sql.Timestamp)][externalFieldRef,null()][fromDate,2014-07-15 22:27:47.494(java.sql.Timestamp)][lastUpdatedStamp,2014-07-15 23:50:46.078(java.sql.Timestamp)][lastUpdatedTxStamp,2014-07-15 23:50:46.016(java.sql.Timestamp)][requiredField,N(java.lang.String)][sequenceNum,3(java.lang.Long)][surveyId,10000(java.lang.String)][surveyMultiRespColId,null()][surveyMultiRespId,null()][surveyPageSeqId,null()][surveyQuestionId,10061(java.lang.String)][thruDate,null()][withSurveyOptionSeqId,Y(java.lang.String)][withSurveyQuestionId,10020(java.lang.String)] (SQL Exception while executing the following:UPDATE public.SURVEY_QUESTION_APPL SET THRU_DATE=?, SURVEY_PAGE_SEQ_ID=?, SURVEY_MULTI_RESP_ID=?, SURVEY_MULTI_RESP_COL_ID=?, REQUIRED_FIELD=?, SEQUENCE_NUM=?, EXTERNAL_FIELD_REF=?, WITH_SURVEY_QUESTION_ID=?, WITH_SURVEY_OPTION_SEQ_ID=?, LAST_UPDATED_STAMP=?, LAST_UPDATED_TX_STAMP=?, CREATED_STAMP=?, CREATED_TX_STAMP=? WHERE SURVEY_ID=? AND SURVEY_QUESTION_ID=? AND FROM_DATE=? (ERROR: insert or update on table "survey_question_appl" violates foreign key constraint "srvyqstapl_svqo" Detail: Key (with_survey_question_id, with_survey_option_seq_id)=(10020, Y) is not present in table "survey_question_option".)) (Error while updating: [GenericEntity:SurveyQuestionAppl][createdStamp,2014-07-15 22:27:47.494(java.sql.Timestamp)][createdTxStamp,2014-07-15 22:27:47.406(java.sql.Timestamp)][externalFieldRef,null()][fromDate,2014-07-15 22:27:47.494(java.sql.Timestamp)][lastUpdatedStamp,2014-07-15 23:50:46.078(java.sql.Timestamp)][lastUpdatedTxStamp,2014-07-15 23:50:46.016(java.sql.Timestamp)][requiredField,N(java.lang.String)][sequenceNum,3(java.lang.Long)][surveyId,10000(java.lang.String)][surveyMultiRespColId,null()][surveyMultiRespId,null()][surveyPageSeqId,null()][surveyQuestionId,10061(java.lang.String)][thruDate,null()][withSurveyOptionSeqId,Y(java.lang.String)][withSurveyQuestionId,10020(java.lang.String)] (SQL Exception while executing the following:UPDATE public.SURVEY_QUESTION_APPL SET THRU_DATE=?, SURVEY_PAGE_SEQ_ID=?, SURVEY_MULTI_RESP_ID=?, SURVEY_MULTI_RESP_COL_ID=?, REQUIRED_FIELD=?, SEQUENCE_NUM=?, EXTERNAL_FIELD_REF=?, WITH_SURVEY_QUESTION_ID=?, WITH_SURVEY_OPTION_SEQ_ID=?, LAST_UPDATED_STAMP=?, LAST_UPDATED_TX_STAMP=?, CREATED_STAMP=?, CREATED_TX_STAMP=? WHERE SURVEY_ID=? AND SURVEY_QUESTION_ID=? AND FROM_DATE=? (ERROR: insert or update on table "survey_question_appl" violates foreign key constraint "srvyqstapl_svqo" Detail: Key (with_survey_question_id, with_survey_option_seq_id)=(10020, Y) is not present in table "survey_question_option".)))
        

        Which is happening because boolean values (Y or N) are not known as surveyQuestionOptions.

        Show
        pfm.smits Pierre Smits added a comment - The Following Errors Occurred: Exception thrown while storing entity value: org.ofbiz.entity.GenericEntityException: Error while updating: [GenericEntity:SurveyQuestionAppl][createdStamp,2014-07-15 22:27:47.494(java.sql.Timestamp)][createdTxStamp,2014-07-15 22:27:47.406(java.sql.Timestamp)][externalFieldRef, null ()][fromDate,2014-07-15 22:27:47.494(java.sql.Timestamp)][lastUpdatedStamp,2014-07-15 23:50:46.078(java.sql.Timestamp)][lastUpdatedTxStamp,2014-07-15 23:50:46.016(java.sql.Timestamp)][requiredField,N(java.lang. String )][sequenceNum,3(java.lang. Long )][surveyId,10000(java.lang. String )][surveyMultiRespColId, null ()][surveyMultiRespId, null ()][surveyPageSeqId, null ()][surveyQuestionId,10061(java.lang. String )][thruDate, null ()][withSurveyOptionSeqId,Y(java.lang. String )][withSurveyQuestionId,10020(java.lang. String )] (SQL Exception while executing the following:UPDATE public .SURVEY_QUESTION_APPL SET THRU_DATE=?, SURVEY_PAGE_SEQ_ID=?, SURVEY_MULTI_RESP_ID=?, SURVEY_MULTI_RESP_COL_ID=?, REQUIRED_FIELD=?, SEQUENCE_NUM=?, EXTERNAL_FIELD_REF=?, WITH_SURVEY_QUESTION_ID=?, WITH_SURVEY_OPTION_SEQ_ID=?, LAST_UPDATED_STAMP=?, LAST_UPDATED_TX_STAMP=?, CREATED_STAMP=?, CREATED_TX_STAMP=? WHERE SURVEY_ID=? AND SURVEY_QUESTION_ID=? AND FROM_DATE=? (ERROR: insert or update on table "survey_question_appl" violates foreign key constraint "srvyqstapl_svqo" Detail: Key (with_survey_question_id, with_survey_option_seq_id)=(10020, Y) is not present in table "survey_question_option" .)) (Error while updating: [GenericEntity:SurveyQuestionAppl][createdStamp,2014-07-15 22:27:47.494(java.sql.Timestamp)][createdTxStamp,2014-07-15 22:27:47.406(java.sql.Timestamp)][externalFieldRef, null ()][fromDate,2014-07-15 22:27:47.494(java.sql.Timestamp)][lastUpdatedStamp,2014-07-15 23:50:46.078(java.sql.Timestamp)][lastUpdatedTxStamp,2014-07-15 23:50:46.016(java.sql.Timestamp)][requiredField,N(java.lang. String )][sequenceNum,3(java.lang. Long )][surveyId,10000(java.lang. String )][surveyMultiRespColId, null ()][surveyMultiRespId, null ()][surveyPageSeqId, null ()][surveyQuestionId,10061(java.lang. String )][thruDate, null ()][withSurveyOptionSeqId,Y(java.lang. String )][withSurveyQuestionId,10020(java.lang. String )] (SQL Exception while executing the following:UPDATE public .SURVEY_QUESTION_APPL SET THRU_DATE=?, SURVEY_PAGE_SEQ_ID=?, SURVEY_MULTI_RESP_ID=?, SURVEY_MULTI_RESP_COL_ID=?, REQUIRED_FIELD=?, SEQUENCE_NUM=?, EXTERNAL_FIELD_REF=?, WITH_SURVEY_QUESTION_ID=?, WITH_SURVEY_OPTION_SEQ_ID=?, LAST_UPDATED_STAMP=?, LAST_UPDATED_TX_STAMP=?, CREATED_STAMP=?, CREATED_TX_STAMP=? WHERE SURVEY_ID=? AND SURVEY_QUESTION_ID=? AND FROM_DATE=? (ERROR: insert or update on table "survey_question_appl" violates foreign key constraint "srvyqstapl_svqo" Detail: Key (with_survey_question_id, with_survey_option_seq_id)=(10020, Y) is not present in table "survey_question_option" .))) Which is happening because boolean values (Y or N) are not known as surveyQuestionOptions.
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Here is the patch for this issue.
        Added missing value attribute for option tag.

        Show
        deepak.dixit Deepak Dixit added a comment - Here is the patch for this issue. Added missing value attribute for option tag.
        Hide
        toashishvijay Ashish Vijaywargiya added a comment -

        Thanks Pierre for creating the issue.

        Thanks Deepak for the contribution. Your changes are committed on following revisions:

        trunk - r1646939
        R13.07 - 1646940
        R12.04 - 1646940

        Show
        toashishvijay Ashish Vijaywargiya added a comment - Thanks Pierre for creating the issue. Thanks Deepak for the contribution. Your changes are committed on following revisions: trunk - r1646939 R13.07 - 1646940 R12.04 - 1646940
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Please Ashish change the "Fix versions" to unreleased ones.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Please Ashish change the "Fix versions" to unreleased ones.

          People

          • Assignee:
            toashishvijay Ashish Vijaywargiya
            Reporter:
            pfm.smits Pierre Smits
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development