Details
Description
to reproduce:
create an event, enable multi registrants using same email
select a profile for the additional registrants that includes indiv/contact AND at least one participant field
error:
Allow multiple registrations from the same email address requires a profile of type 'Individual'
reproducible on sandbox:
http://drupal.demo.civicrm.org/civicrm/event/manage/registration?reset=1&action=update&id=3
just click save. note that the primary and additional profiles are the same, and that they contain one participant custom field
issue:
in CRM/Event/Form/ManageEvent/Registration.php, line 362, we do a profile check on the additional profile to make sure it is an individual type profile. that calls CRM_Core_BAO_UFGroup::getProfiles which calls CRM_Core_BAO_UFField.php::getProfileType
this last function only returns one value – even though the profile type has multiple values (e.g. Individual,Contact,Participant). if we change the function call in UFGroup.php line 2021 to: $ptype = CRM_Core_BAO_UFField::getProfileType($id, false, $onlyPure, true ); (adding the last "true" parameter) then it ignores whether the profile is used for components, and focuses only on whether it is indiv/house/org or a subtype. actually – i didn't test on subtypes. i think that's what we want for this – we just want to make sure it's not a house/org profile.
i didn't look where else that function is called, so i don't know further implications. as it stands, UFField::getProfileType seems pretty misleading since you don't know what value of several it will return.