Summary
The legacy profile fields field_profile_function and field_profile_organization have been removed and replaced with a new affiliation system that provides more flexibility and better integration with group memberships.
What Changed
Removed Fields
The following fields have been removed from the profile entity:
field_profile_function- Previously stored a user's job function/role as a simple text fieldfield_profile_organization- Previously stored a user's organization name as a simple text field
New Alternative: Affiliation System
The removed fields are replaced by a comprehensive affiliation system with the following components:
1. Extra Fields (Profile Display)
Two new extra fields are now available for profile display:
primary_affiliation_name- Displays the group label from the user's primary affiliationprimary_affiliation_function- Displays the function/role from the user's primary affiliation
These extra fields can be configured in any profile view mode (Display settings) and will automatically pull data from the appropriate affiliation source.
2. Affiliation Data Sources
The primary affiliation data is determined by the following priority:
- Group-based affiliation: If the user has selected a group affiliation via the
field_group_affiliationfield, the organization name comes from the group label, and the function comes from the group membership's field_affiliation_function field. - Non-platform affiliation: If no group affiliation is selected, data comes from the first item in the
field_other_affiliationsparagraph field, which contains:field_affiliation_org_name- Organization namefield_affiliation_org_function- Function/role
3. New Fields
The affiliation system introduces:
field_group_affiliation- Entity reference field to select a primary group affiliationfield_other_affiliations- Paragraph field to store non-platform affiliations (organization name and function)field_affiliation_function- Added to group membership entity for storing function/role within a group
Migration Path
Automatic Data Migration
Update hook social_profile_update_250005() automatically migrates existing data:
- Data from
field_profile_functionandfield_profile_organizationis migrated to paragraph entities - New paragraphs are created with type
other_affiliations - The paragraphs are attached to the
field_other_affiliationsfield on the profile
Automatic Display Configuration Update
Update hook social_profile_update_250004() automatically updates all profile view displays:
- Replaces
field_profile_organizationcomponent withprimary_affiliation_name - Replaces
field_profile_functioncomponent withprimary_affiliation_function - Preserves weight and region settings
Field Removal
Update hook social_profile_update_250006() removes the deprecated fields:
- Deletes field configurations for
field_profile_functionandfield_profile_organization - Removes field storage definitions if they are no longer in use
Impact on Views
Removed View Fields
The following Views have had the field_profile_organization field removed:
Event Management Views:
views.view.event_manage_enrollment_requests- Enrollment requests table no longer shows organization columnviews.view.event_manage_enrollments- Enrollments management table no longer shows organization columnviews.view.event_manage_enrollment_invites- Enrollment invites table no longer shows organization column
Group Management Views:
views.view.group_manage_members- Group members table no longer includes the organization field
API Changes
Profile Entity Interface
The profile entity now implements ProfileAffiliationInterface which provides methods:
// Get the complete primary affiliation array
$affiliation = $profile->getPrimaryAffiliation();
// Returns: ['affiliation_name' => '...', 'affiliation_function' => '...']
// Get just the organization name
$name = $profile->getPrimaryAffiliationName();
// Get just the function/role
$function = $profile->getPrimaryAffiliationFunction();
// Add a non-platform affiliation
$profile->addNonPlatformAffiliation('Organization Name', 'Job Function');
Group Membership
Group memberships now support the field_affiliation_function field to store the user's role/function within that group.
Backwards Compatibility
Breaking Change: This is a breaking change for:
- Custom code that directly accesses
$profile->field_profile_functionor$profile->field_profile_organization - Views configurations that reference these fields
- Custom themes that render these fields directly
- GraphQL queries expecting these fields
- CSV exports and data integrations referencing these fields
Action Required
For Site Administrators
- Review profile view modes to ensure the new extra fields (
primary_affiliation_nameandprimary_affiliation_function) are displayed where needed - Check custom Views that may have referenced the old fields
For Developers
- Update any custom code that accesses
field_profile_functionorfield_profile_organizationto use the new API methods: - Replace
$profile->field_profile_function->valuewith$profile->getPrimaryAffiliationFunction() - Replace
$profile->field_profile_organization->valuewith$profile->getPrimaryAffiliationName() - Update custom Views that reference these fields to use the profile's table view mode or implement custom field handlers
- Update any GraphQL queries, REST API integrations, or data exports to use the new affiliation fields
- Review and update any form alter hooks that may have modified these fields