BuddyBoss Home – Web Support Forums Solutions Social Learner profile fields doubling

Viewing 8 posts - 1 through 8 (of 8 total)
  • Question

    #54813
    @dearingdraws

    He 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

    #54868
    @vapvarun

    Hi @dearingdraws
    Please modify function boss_customizer_xprofile_field_choices()
    replace the complete function with following codes
    /boss/buddyboss-inc/buddyboss-framework/options-init.php

    
    
    public 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 Dubey

    #54870
    @dearingdraws

    Thanx Varun. Could you help me with this? I will sent my log-in details. How does that work?

    #54872
    @vapvarun

    Hi @dearingdraws
    Please send your login details from our contact page, and also include this forum url for reference ‘
    Regards

    #55794
    @mln83

    Hi @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,
    Michael

    #55796
    @mln83

    For 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;
    		}
    #56026
    @vapvarun

    Hi @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 Dubey

    #56027
    @mln83

    Hi @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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The question ‘profile fields doubling’ is closed to new replies.