Fix: Preserve description field during user sync to prevent being reset to '1'#3225
Open
birdy1976 wants to merge 1 commit into
Open
Fix: Preserve description field during user sync to prevent being reset to '1'#3225birdy1976 wants to merge 1 commit into
birdy1976 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This fix resolves an issue where the user description field was being reset to '1' on every user sync when no explicit field mapping was configured.
Root Cause
Commit 7e07704 ("Further performance improvements") removed code that explicitly preserved the description field with the assumption that
get_complete_user_data()would properly load all user fields including custom profile fields.However,
get_complete_user_data()does not reliably load custom profile fields. When the description field was missing from the user object passed toapply_configured_fieldmap(), it would get defaulted to empty/'1' even when no mapping was configured for it.Solution
This restores the two lines of code that explicitly fetch and preserve the current description field value before calling
apply_configured_fieldmap():This ensures the description field is always available, preventing it from being unexpectedly overwritten.
Changes
classes/feature/usersync/main.phpTesting
✓ Syntax validation passed
✓ Code reviewed against git history
✓ Follows previous implementation pattern
Affected Versions
This fix applies to:
References