Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1
-
Fix Version/s: 3.1
-
Component/s: CiviCRM Profile
-
Labels:None
Description
This occurred in 3.1 beta 2 using Drupal 6.14 with MySQL 5.
When you create a Profile using a Custom Field for an Organization record, the Profile system forces you to associate the Custom Field with one Organization Subtype. Then when you try to use the Profile to add a new Organization, it forces you to choose that Subtype only for the new record.
The desired outcome was a Profile for adding a new Organization record. This Profile would allow the user to choose any Organization Subtype, and fill in a Custom Field that was enabled for several Organization Subtypes. (In my case it was enabled for all three of my Organization Subtypes.)
I believe that the fix should be that the CiviCRM Profile Fields should display the Custom Field as a choice for the Organization type, in addition to (or instead of) associating this choice with the Subtypes.
Steps to reproduce:
A. Create Organization Subtypes
Create three Subtypes for Organization records, label them whatever you like, e.g.
vanilla, strawberry, chocolate.
B. Create a Custom Field
1. Go to Custom Data
/civicrm/admin/custom/group?reset=1
and create New Group of Custom Fields
2. New Custom Data Group page
Group Name: Org Custom Fields
Used For: select Organization, then select all thre subtypes previously defined:
vanilla, strawberry, chocolate
Is this Custom Data Group active?: checked
All other fields: accept defaults
Save the group
3. Create a custom field
Create a custom field for the Organization record type. E.g. create a Note field using TextArea for Organization "motto". Enable the field.
C. Profile
1. Go to CiviCRM Admin
2. Create a new Profile
/civicrm/admin/uf/group?action=add&reset=1
3. Fill out Profile form as follows
Profile Name: Add new Org
Used for: check Profile only
Order: accept default
Is this CiviCRM Profile active?: check
Advanced Settings: probably doesn't matter what you pick here
4. Save the new Profile
5. CiviCRM Profile Fields
a. Field #1
Field Name: Organization - Organization Name
Required?: checked
All other fields: accept defaults
Click Save and New
b. Field #2
Field Name: Contacts - Contact Subtype
Required?: checked
All other fields: accept defaults
Click Save and New
c. Field #3
Here's where the bug happens: you cannot add the Custom Field created in step (B) above as an Organization field.
Field Name: select Organization
Notice that in second dropdown list, you cannot select the Custom Field because it's not displayed.
If you instead choose "Organization - vanilla", you will be able to choose the Custom Field in the second dropdown list. However your Profile will then only let you create new Organizations of this Subtype, which is not the desired outcome.