Support » Plugin: BuddyPress Groupblog » [Plugin: BuddyPress Groupblog] Ajax Backend Conflict

Viewing 2 replies - 1 through 2 (of 2 total)
  • WP3.2.1 + BuddyPress1.2.9 + BP Groupblog1.5.
    And.This fix.
    http://wordpress.org/support/topic/plugin-buddypress-groupblog-no-bp-groupblogs-menu-using-wp-31-and-bp-128

    I have the error,too.

    Ex1.Catchable fatal error: Object of class WP_Error could not be converted to string in /var/www/wp-includes/ms-blogs.php **
    Ex2. redirect loop
    Ex3. Dashboard > Network Admin > Sites
    Path / is Two. New / I delete New /. if you have two / , you delete New /.
    Normally it operates, and it becomes an error at times. Operation is unstable.

    Cause, maybe..
    ・ Mistake of your BuddyPress Theme .
    ・ /bp-groupblog/groupblog/js/general.js doesn’t operate normally.

    Example. My Theme . Source code ,<head>…</head>. I found..

    <script type=’text/javascript’ src=’http://****/wp-includes/js/l10n.js?ver=20101110′></script>
    <script type=’text/javascript’ src=’http://***/wp-content/plugins/bp-groupblog/groupblog/js/general.js?ver=3.2.1′></script>
    <script type=’text/javascript’ src=’http://****/wp-includes/js/jquery/jquery.js?ver=1.6.1′></script>
    <script type=’text/javascript’ src=’http://****/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js?ver=3.2.1′></script>

    This Case don’t work.
    “/bp-groupblog/groupblog/js/general.js?ver=3.2.1′” should be at the end.

    <script type=’text/javascript’ src=’http://****/wp-includes/js/l10n.js?ver=20101110′></script>
    <script type=’text/javascript’ src=’http://****/wp-includes/js/jquery/jquery.js?ver=1.6.1′></script>
    <script type=’text/javascript’ src=’http://****/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js?ver=3.2.1′></script>
    <script type=’text/javascript’ src=’http://***/wp-content/plugins/bp-groupblog/groupblog/js/general.js?ver=3.2.1′></script>

    This Case work.

    FIX can be done by two methods.The order of reading JavaScrit is changed.

    *Method1: FIX In Your BuddyPress Theme.
    ・wp-content/themes/your_Bptheme/header.php
    ・wp-content/themes/your_Bptheme/buddypress/functions-buddypress.php

    My Case: in functions-buddypress.php

    #
    ##--- Find -------------
    #
    /* Load the BuddyPress javascript and css */
    /* We use !bp_is_blog_page() here to only load the JS and CSS on BuddyPress pages to save on load time */
    /* We want to load the adminbar css on all pages so it has been taken out of the if statement */
    /* We are going to load the JS from the BuddyPress plugin directory so we always use the latest version */
    function theme_loaded_init() {
    	if (!bp_is_blog_page()) {
    		wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
    
    		}
    		wp_enqueue_style( 'buddypressadminbar', MY_THEME_URL . '/buddypress/style-adminbar.css', false, '0.1', 'screen' );
    		wp_enqueue_style( 'buddypress', MY_THEME_URL . '/buddypress/style-****.css', false, '0.1', 'screen' );
    	}
    
    add_action('wp_head', 'theme_loaded_init', 5);
    
    #
    ##--- Replace -------------
    #
    add_action('wp_head', 'theme_loaded_init', 5);
    
    #
    ##--- With  -------------
    #
    
    add_action('template_redirect', 'theme_loaded_init', 0);

    ————————————————————
    *Method2: FIX In
    ・wp-content/plugins/bp-groupblog/bp-groupblog-cssjs.php

    #
    ##--- Find -------------
    #
    function bp_groupblog_add_js() {
      global $bp;
    
    	if ( $bp->current_component == $bp->groups->slug && ( ('group-blog' == $bp->action_variables[0]) || ('group-blog' == $bp->action_variables[1]) ) )
    	  if ( file_exists( STYLESHEETPATH . '/groupblog/js/general.js' ) )
    			wp_enqueue_script( 'bp-groupblog-js', get_stylesheet_directory_uri() . '/groupblog/js/general.js' );
    		else
    		  wp_enqueue_script( 'bp-groupblog-js', WP_PLUGIN_URL . '/bp-groupblog/groupblog/js/general.js' );
    }
    add_action( 'template_redirect', 'bp_groupblog_add_js', 1 );
    
    #
    ##--- Replace -------------
    #
    add_action( 'template_redirect', 'bp_groupblog_add_js', 1 );
    
    #
    ##--- With  -------------
    #
    add_action( 'wp_head', 'bp_groupblog_add_js', 6 );

    6 is
    My “add_action(‘wp_head’, ‘theme_loaded_init’, 5) in My Bptheme/buddypress/functions-buddypress.php.

    I am no good english ,sorry..

    Plugin Author reblevins

    (@reblevins)

    Hi there,
    Thanks utaka for posting this fix. I’m not the javascript guru, so I’ll leave it to the other contributors to see what needs to be done.

    Rodney

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: BuddyPress Groupblog] Ajax Backend Conflict’ is closed to new replies.