Hi @micster-
The docs-in-group plugin mostly worked well for me in my recent test. I was able to update one piece that was causing odd behavior because of a recent change to BuddyPress. I’ve created a pull request to fix the issue and imagine that the plugin author will review it pretty soon.
In vanilla BP Docs, there is a setting for choosing who can associate docs with each group. Visit a group’s “Manage” section, then look for the “Docs” tab. You can choose to enable/disable docs for the group and set the “Minimum role to associate Docs with this group”.
You could require that users select a group when using the create/edit form. You could do this via JavaScript form validation, like this: https://www.tutorialspoint.com/javascript/javascript_form_validations.htm
Or you could refuse to save it if “none” were selected. There’s a handy action point for that: https://github.com/boonebgorges/buddypress-docs/blob/master/includes/query-builder.php#L497
Something like the following added to your bp-custom.php
would probably work:
add_filter( 'bp_docs_filter_result_before_save', function( $result, $args ) {
if ( empty( $args['group_id'] ) ) {
$result['error'] = true;
$result['message'] = 'You must choose a group.';
}
return $result;
}, 10, 2 );
Have fun!