Custom Field Boolean (Yes no radio button) displays No for null values.

Created on 5 May 2022, about 2 years ago
Updated 9 May 2024, about 1 month ago

Problem/Motivation

CiviCRM custom fields of type "Yes/No" radio button input can have three states Yes/No NULL.
Currently when displayed via Drupal Views NULL is displayed as NUll.

Steps to reproduce

Create a custom field (on contacts but should apply elsewhere) of type "Yes or No", Field Input type "radio buttons" with no default value. Ensure that there is another custom field in the same group.

Then set up 4 contacts such that contact A has value yes, contact B has value No, Contact C has a value for another custom field in this group but the yes no custom field is null, and Contact D has no values for any custom field in the group - there is no row in the custom table for that contact.

Set up a view to display these four contacts with the custom field value. You should see that Contact A has Yes, the rest display No.

Add the Gender field to the view - and set up values in the gender field of set and unset. Compare the display of NULL gender values verses the Custom field.

Proposed resolution

Contact A should show Yes, Contact B should show No and Contacts C and D should show nothing.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024