OpenSanghaFoundation / OSF

Bug/Feature requests tracking and documentation managament
https://opensanghafoundation.org
0 stars 0 forks source link

Can't change user profile photo due to conflict between Ultimate Member and BuddyPress #11

Closed coiby closed 2 months ago

coiby commented 4 months ago

Describe the bug

A user can't change the profile photo.

To Reproduce Steps to reproduce the behavior (after having logged-in):

  1. Go to https://opensanghafoundation.org/newsite/user?um_action=edit
  2. Click on the profile photo and then click on the "Change photo" label
  3. Upload a new picture
  4. The old profile photo is still shown

Expected behavior

The new uploaded picture should be shown as the profile photo. Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

coiby commented 4 months ago

Upon closer examination, I've investigated the mechanism by which an image in avatars masks UM's profile photo, confirming that BuddyPress is indeed causing interference. My analysis, based on the bp_core_fetch_avatar function found in plugins/buddypress/bp-core/bp-core-avatars.php, reveals that BuddyPress locates the most recent image in uploads/avatars/USERID and utilizes it as the profile photo. Consequently, disabling BuddyPress or removing images in uploads/avatars/USERID could potentially restore functionality to the profile photo update process. Thus, my deductions lead me to conclude: 1) It appears that your profile photo was altered simply by uploading an image to uploads/avatars/1271/profile_photo.png. 2) Attempts such as update_user_meta($id, $field, $value) are ineffective because BuddyPress does not search for the profile photo in the usermeta table. To resolve the issue of failing profile photo updates, the appropriate course of action involves relocating the profile photo from uploads/avatars/USERID to uploads/ultimate/USERID, accompanied by an update to the profile_photo field in the usermeta table.

coiby commented 2 months ago

BuddyPress has been disabled and we are going to delete it. So this issue will no longer happen.