boonebgorges / bp-groupblog

BuddyPress Groupblog
GNU General Public License v3.0
15 stars 10 forks source link

Fix for broken 'enable group blog' #5

Closed christianwach closed 12 years ago

christianwach commented 12 years ago

Hi Boone,

I'm working extensively with bp-groupblog over the next month or so, and would like to open a conversation with you about this plugin. The first thing to say is "thank you!"

Anyway, my first offering is this, which fixes the operation of general.js during the group creation process. It needs to declare jQuery as a dependency:

function bp_groupblog_add_js() {
    if ( bp_is_groups_component() && bp_is_action_variable( 'group-blog' ) ) {
        if ( file_exists( STYLESHEETPATH . '/groupblog/js/general.js' ) )
            wp_enqueue_script( 'bp-groupblog-js', get_stylesheet_directory_uri() . '/groupblog/js/general.js', array('jquery') );
        else
            wp_enqueue_script( 'bp-groupblog-js', WP_PLUGIN_URL . '/bp-groupblog/groupblog/js/general.js', array('jquery') );
    }
}

Also, when I set WP_DEBUG to true, I get errors creating the group blog because, on line 972 and 1003 of 'bp-groupblog.php', user properties are incorrectly referenced:

$groupblog_blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid );

should be:

$groupblog_blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );

I'll fork the project and submit pull requests in future, as this issue queue is a bit cumbersome.

Thanks again!

Christian

boonebgorges commented 12 years ago

Thanks for the fixes, and thanks in advance for whatever else you've got coming our way :)

christianwach commented 12 years ago

Thanks for the commits, project now forked - will keep the fixes coming as I find them.

Cheers,

Christian