Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] BP 2.6 – bp_get_current_group_id() fatal error

  • @sharmavishal

    Participant

    on a wp multisite. bp network activated. setup a new subdomain. neither the site nor the admin comes up. following error

    Fatal error: Call to undefined function bp_get_current_group_id() in /wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-extension.php on line 484

Viewing 2 replies - 26 through 27 (of 27 total)
  • @metaverso

    Participant

    my fix:

    Fatal error: Call to undefined function bp_get_current_group_id() in /wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-extension.php on line 488

    [ soluction ]

    public static function get_group_id() {
    
    		
    	if ( defined( 'WP_NETWORK_ADMIN' ) && bp_is_active('groups')) {   // -----------fix add line 1 
    	echo get_called_class();// -----------fix add line 2                     
    
    	
    		// Usually this will work.
    		$group_id = bp_get_current_group_id();
    
    		// On the admin, get the group id out of the $_GET params.
    		if ( empty( $group_id ) && is_admin() && ( isset( $_GET['page'] ) && ( 'bp-groups' === $_GET['page'] ) ) && ! empty( $_GET['gid'] ) ) {
    			$group_id = (int) $_GET['gid'];
    		}
    
    		// This fallback will only be hit when the create step is very
    		// early.
    		if ( empty( $group_id ) && bp_get_new_group_id() ) {
    			$group_id = bp_get_new_group_id();
    		}
    
    		// On some setups, the group id has to be fetched out of the
    		// $_POST array
    		// @todo Figure out why this is happening during group creation.
    		if ( empty( $group_id ) && isset( $_POST['group_id'] ) ) {
    			$group_id = (int) $_POST['group_id'];
    		}
    
    		return $group_id;
    		}// -----------fix add line 3
    	}

    @r-a-y

    Keymaster

    @metaverso – Can you revert your changes and try my fix?
    https://buddypress.trac.wordpress.org/attachment/ticket/7140/7140.01.patch

    If that doesn’t work for you, can you tell me what BP plugins you are using?

Viewing 2 replies - 26 through 27 (of 27 total)
  • The topic ‘[Resolved] BP 2.6 – bp_get_current_group_id() fatal error’ is closed to new replies.
Skip to toolbar