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

Profiles : Add a group type column and implement form rules to provide better control over which types of profile fields can be combined and reduce database queries


    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Core CiviCRM
    • Labels:


      1. Schema changes:

      • Add a group_type column to civicrm_uf_group - varchar 255. This column will store a comma separated list of the type(s) of profile fields (uf_field.field_type) contained in the profile (uf) group.
      • Remove the unused civicrm_uf_group.form_type column.

      2. Modify the hierarchical select structure used for Profile Fields as follows:

      • a new top-level option = Contacts
      • move all 2nd level options which apply to ALL contact types so that they are linked to "Contacts" rather than "Individuals", "Households", "Organizations".
        Contacts -> Email
        Contacts -> Street Address

      3. Set and update the civicrm_uf_group.group_type value when a profile field is created, updated or deleted in that profile group. group_type should always be a list of the unique field_type values of all fields in the profile.

      EXAMPLE: If a profile contains Street Address, Last Name, and Participant Role fields, the group_type value is "Contact, Individual, Participant"

      Disabling a profile field does NOT modify the uf_group.group_type.

      4. Add formRules to create / update profile field (ufField) which block the following "combinations":
      Ind + Org
      Household + Org
      Ind + Household
      Contribution + Participant
      Contrib + Membership
      Partic + Membership

      EXAMPLE: My uf_group.group_type col = "Individual, Contribution". If I try to add a "Participant" field, an error is given.




            • Assignee:
              sunny.sharma Sunny Sharma
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: