boonebgorges/bp-groupblog — Issue #5: Fix for broken 'enable group blog'
Author: christianwach
Created: 2012-03-01 14:12:43+00:00
State: open

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:

```php
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:

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

should be:

```php
$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