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

Problem with integer radio custom field with 0 value

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.8
    • Fix Version/s: 3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Actually when form is submitted and if radio is not selected than field with 0 value get saved in DB.

      ===================================================================================================================
      When trying to verify ( http://issues.civicrm.org/jira/browse/CRM-4601 ), I created a custom group with (among others) an integer radio field with 0 and 1 options (both values and labels). When I edit a contact's custom data, this field is set to 0 even if no option is chosen.

      This is most probably due to QuickForm's conflating of zero and null (no value). If so, you can try side-stepping it the same way as I did in CRM/Contact/Form/Merge.php (the $_qfZeroBug variable).

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              shot Piotr Szotkowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified