buddypress-multi-network icon indicating copy to clipboard operation
buddypress-multi-network copied to clipboard

Users are not being displayed on the BuddyPress members page

Open desaiuditd opened this issue 11 years ago • 42 comments

When a user is added to a blog on a multisite environment; that user is not being listed on the members page (front-end) of BuddyPress; though at the admin side, users are displayed correctly.

I debugged the issue a bit and I came to a conclusion that 'wp_bp_mnetwork_users' table is not being populated correctly after a user is added to a blog.

I digged up further to find the root cause. I saw 'is_active' column in 'wp_bp_mnetwork_users' table. Take a note that it does not have any default value in the schema and it is 'NOT NULL' field. I scanned the whole code and found that it is not being used in the plugin at all. Can you please explain what is the purpose of introducing 'is_active' field in the schema and not using it anywhere ?

The main cause for missing entries is in the add_user function (Class BPNetworkUsers - users.php). There is an insert query which is not passing value for 'is_active' field. Since this field is a NOT NULL field and has no default value it is not allowing us to add entry in the table.

So 'is_active' column is causing the issue. If it is going to be used in future; then can we set its default value or set it as a NULL field ? We can also change the insert query in the add_user function to pass the 'is_active' value explicitly.

desaiuditd avatar Dec 26 '13 13:12 desaiuditd