Change record status: 
Project: 
Introduced in branch: 
13.0.0
Introduced in version: 
13.0.0
Description: 

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 field
  • field_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 affiliation
  • primary_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:

  1. Group-based affiliation: If the user has selected a group affiliation via the field_group_affiliation field, the organization name comes from the group label, and the function comes from the group membership's field_affiliation_function field.
  2. Non-platform affiliation: If no group affiliation is selected, data comes from the first item in the field_other_affiliations paragraph field, which contains:
    • field_affiliation_org_name - Organization name
    • field_affiliation_org_function - Function/role

3. New Fields

The affiliation system introduces:

  • field_group_affiliation - Entity reference field to select a primary group affiliation
  • field_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_function and field_profile_organization is migrated to paragraph entities
  • New paragraphs are created with type other_affiliations
  • The paragraphs are attached to the field_other_affiliations field on the profile

Automatic Display Configuration Update

Update hook social_profile_update_250004() automatically updates all profile view displays:

  • Replaces field_profile_organization component with primary_affiliation_name
  • Replaces field_profile_function component with primary_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_function and field_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 column
  • views.view.event_manage_enrollments - Enrollments management table no longer shows organization column
  • views.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:

  1. Custom code that directly accesses $profile->field_profile_function or $profile->field_profile_organization
  2. Views configurations that reference these fields
  3. Custom themes that render these fields directly
  4. GraphQL queries expecting these fields
  5. CSV exports and data integrations referencing these fields

Action Required

For Site Administrators

  1. Review profile view modes to ensure the new extra fields (primary_affiliation_name and primary_affiliation_function) are displayed where needed
  2. Check custom Views that may have referenced the old fields

For Developers

  1. Update any custom code that accesses field_profile_function or field_profile_organization to use the new API methods:
  2. Replace $profile->field_profile_function->value with $profile->getPrimaryAffiliationFunction()
  3. Replace $profile->field_profile_organization->value with $profile->getPrimaryAffiliationName()
  4. Update custom Views that reference these fields to use the profile's table view mode or implement custom field handlers
  5. Update any GraphQL queries, REST API integrations, or data exports to use the new affiliation fields
  6. Review and update any form alter hooks that may have modified these fields
Impacts: 
Site builders, administrators, editors
Module developers
Themers