Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.2.8
-
Fix Version/s: 3.0
-
Component/s: CiviContribute, CiviMember
-
Labels:None
Description
Currently, if an online contribution / membership signup page includes the On Behalf of feature AND includes a profile with contribution or membership fields (core or custom) - the values for these are not handled / displayed properly (they are assumed to be linked to the individual completing the form - but they are actually linked to the organization). More details here: http://forum.civicrm.org/index.php/topic,9677.0.html
Short-term Solution
=================
Add a form rule that says that "mixed" and "organization" profiles are not allowed in online contribution pages IF onBehalf is enabled (throw an appropriately clear error from Contribution/Form/Main preProcess). So you could embed an Individual profile AND / OR you could embed a "component" profile (membership / contribution fields). But Organization fields OR a mix of individual+component fields are NOT allowed.
This way, Individual profiles alway uses the individual's contact id. Component profiles use organization's contact id IF user has selected onBehalf (since the component records belong to the org), and uses individual's id if user has NOT selected onBehalf (since the component records belong to the person filling out the form).
NOTE: This all get's better if when we allow the onBehalf form snippet to be defined / extended by IT'S OWN profile. Then we know to use org's contact_id for THOSE fields and those fields only. (scheduled for future release)