Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-6044

Custom Data does not load while editing Contact

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.0.5, 3.1.4
    • Fix Version/s: 3.1.4
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Consider these circumstances:

      A custom data field of the data type Integer or Number and field type Select . Its Multiple Choice Options containing an option with Value beginning with a zero . For example 001 , rather than just 1 .

      If a contact was to have this value - the one with the leading zero - its View will correctly show the Label of the Value selected for it. But if this contact was to be Edited , the correct Label will not be automatically selected in the Select list of the Custom Field.

      This causes pain in two ways:

      a. If the field was not Required , the earlier selected Value will be lost silently.
      b. If the field was Required , the earlier selected Value will have to be selected again every time editing the Contact - requiring the user to be smart and opening the Contact in another window first.

      This is caused by the fact that the Multiple Choice Options are stored in a Varchar field in the database (which does not lose any leading zeros) and the Custom Data Table has an Integer or a Double field (which ignores any leading zeros.) Hence, when matching Values in a form, "001" type of Values don't match their "1" type counterparts - and do not get loaded automatically.

        Attachments

        1. CRM-6044_v3.0.patch
          1 kB
          Dhruv Ahuja
        2. CRM-6044_v3.1.patch
          1 kB
          Dhruv Ahuja

          Activity

            People

            • Assignee:
              sushant Sushant Paste
              Reporter:
              dhruvahuja Dhruv Ahuja
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: