BuddyBoss Home – Web › Support Forums › Solutions › Social Learner › profile fields doubling
- This topic has 7 replies, 3 contibutors, and was last updated 8 years, 10 months ago by Michael.
Question
December 21, 2015 at 9:13 am #54813@dearingdrawsHe everybody,
I have a problem with user profile fields on my website.
When I enter extended fields in Buddypress for instance ‘First name’ and ‘Last Name’, it doubles the fields in the backend. In the front end is appears empty. Only when I press edit in the frontend does it appear. But when it appears it appears twice all fields.
Answers
December 22, 2015 at 5:42 am #54868@
AnonymousHi @dearingdraws
Please modify function boss_customizer_xprofile_field_choices()
replace the complete function with following codes
/boss/buddyboss-inc/buddyboss-framework/options-init.phppublic function boss_customizer_xprofile_field_choices() { $options = array(); $xfields = array(); if ( function_exists( 'bp_is_active' ) ) { global $wpdb, $bp; $xfields = $wpdb->get_results( "SELECT id,name FROM <code>{$wpdb->prefix}bp_xprofile_fields</code> "); foreach($xfields as $field) { $options[$field->id] = $field->name; } } return $options; }
If it seems hard for you, you can send your login details from our contact page we will modify at your website.
Regards
Varun DubeyDecember 22, 2015 at 5:47 am #54870@dearingdrawsThanx Varun. Could you help me with this? I will sent my log-in details. How does that work?
December 22, 2015 at 6:18 am #54872@
AnonymousHi @dearingdraws
Please send your login details from our contact page, and also include this forum url for reference ‘
RegardsJanuary 7, 2016 at 4:45 pm #55794@mln83Hi @vapvarun,
Well the fix seems to work but all the fields that I have added are no longer visible from front-end.
Will there be an official update which fixes this double field issue?
Note: I just updated to Boss 2.0.5 but this bug fix has not been included.
Best regards,
MichaelJanuary 7, 2016 at 4:58 pm #55796@mln83For reference this is the code I replaced in Boss 2.0.5:
public function boss_customizer_xprofile_field_choices() { $options = array(); if ( function_exists( 'bp_is_active' ) ) { if ( bp_is_active( 'xprofile' ) && bp_has_profile( array( 'user_id' => get_current_user_id(), 'hide_empty_groups' => false, 'hide_empty_fields' => false ) ) ) { while ( bp_profile_groups() ) { bp_the_profile_group(); $fields = array(); while ( bp_profile_fields() ) { bp_the_profile_field(); $fields[ bp_get_the_profile_field_id() ] = bp_get_the_profile_field_name(); } global $profile_template; if( $profile_template->group_count > 1 ){ $options[bp_get_the_profile_group_name()] = $fields; } else { //no need to show 'optgroup' is there is only one xprofiel field group foreach( $fields as $k=>$l ){ $options[$k] = $l; } } } } } return $options; }
January 11, 2016 at 9:14 am #56026@
AnonymousHi @mln83 , It is already fixed but it was not pushed in our last update
It will be updated in next update, It had issues with specific users who use object cache.Regards
Varun DubeyJanuary 11, 2016 at 9:20 am #56027@mln83Hi @vapvarun,
Thanks for replying. I know that you have been working hard on solving this issue.
Looking forward to the next update 🙂
Best regards,
Michael
- The question ‘profile fields doubling’ is closed to new replies.