Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiselect/checkbox custom field defaults on registration profile #16981

Merged
merged 1 commit into from
Apr 5, 2020

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Apr 5, 2020

Overview

Fixes a bug where certain types of custom fields were not being correctly pre-populated on event registration profiles.

To Reproduce

  1. Create a checkbox or multiselect custom field for contacts.
  2. Add it to a profile.
  3. Add the profile to an event registration page.
  4. Edit your own contact record and fill in some values for that field.
  5. Visit the event registration form. Observe the field is not pre-populated with the expected value (while other fields on the form have been correctly filled-in).

Technical Details

The CRM_Core_BAO_UFGroup::setProfileDefaults() function expects each field to be an array,
but this function was just passing it the number 1. So it did not have enough field metadata
to correctly format each value.

Comments

This touches toxic code so this is a minimal bugfix; however additional cleanup and refactoring is needed.

The CRM_Core_BAO_UFGroup::setProfileDefaults() function expects each field to be an array,
but this function was just passing it the number 1. So it did not have enough field metadata
to correctly format each value.
@civibot
Copy link

civibot bot commented Apr 5, 2020

(Standard links)

@colemanw
Copy link
Member Author

colemanw commented Apr 5, 2020

@pradpnayak please review

@pradpnayak
Copy link
Contributor

This is now working on Event registration page but not for Contribution page.

@pradpnayak
Copy link
Contributor

@colemanw have submitted #16991 to fix on contribution online page

@pradpnayak
Copy link
Contributor

good to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants