Skip to:
Content

bbPress.org

Opened 12 years ago

Last modified 10 years ago

#2089 new defect (bug)

BuddyPress: bbPress1 importer doesn't check BP group status

Reported by: r-a-y's profile r-a-y Owned by: netweb's profile netweb
Milestone: Future Release Priority: normal
Severity: major Version: 2.2
Component: API - Importers Keywords: has-patch
Cc: stephen@…, jmdodd@…

Description

The bbPress1 importer doesn't check to see what the BP group status is when it imports the forum.

So, the forum visibility for a private or hidden BP group forum will be imported as 'Public'.

After importing, if you navigate to a BP user's "Forums > Topics Started" or "Forums > Replies Created", you will be able to view private and hidden forum items.

Attachments (3)

2089.1.diff (15.6 KB) - added by netweb 12 years ago.
2089.2.diff (1.8 KB) - added by netweb 12 years ago.
2809.3.patch (24.0 KB) - added by thebrandonallen 10 years ago.
BuddyPressLegacy.php

Download all attachments as: .zip

Change History (31)

#1 @netweb
12 years ago

  • Cc stephen@… added
  • Keywords 2nd-opinion dev-feedback added
  • Milestone set to Awaiting Review

bbPress 1.x does not support 'private' or 'hidden' forums, so no visibility settings are able to be imported.

BuddyPress' private and hidden group forum permissions are located in the BuddyPress table _bp_groups

The way forward I think would be to create a new import option for 'BuddyPress Group Forums' as this type of instance uses a customised version of bbPress 1.x specific to BuddyPress in that the setup shares the _users & _usermeta tables for WordPress & bbPress.

2089.1.diff is a very quick & dirty non working example of what I am thinking, a fork of bbPress1.php

Also needing to be added is the extra logic to update *_posts.posts_status publish/private/hidden in converter.php and ensure other importers play nice here to.

Last edited 12 years ago by netweb (previous) (diff)

@netweb
12 years ago

#2 @johnjamesjacoby
12 years ago

  • Keywords 2nd-opinion dev-feedback removed
  • Milestone changed from Awaiting Review to 2.3

I'd like to see the group to forum status aligned as part of a tool in Tools > Forums. That way we can make it work on existing installations that may already have this problem.

Moving to 2.3.

#3 @netweb
12 years ago

I'd like to see the group to forum status aligned as part of a tool in Tools > Forums. That way we can make it work on existing installations that may already have this problem.

Agreed, discussed in IRC the other day.

#4 @NickMackz
12 years ago

I assume that the idea would be to make the forum of private groups private and the forum of hidden group hidden?

The problem that I have with this is I want people to be able to see that some of my groups exist, but I don't want them to be able to see anything about anything posted in the group or it's forum. If a group is a set to private and it's forum is set to private, topics posted still show up in the global topics feed but just can't be accessed by non members of the group. I would prefer it that these weren't visible at all unless you are a member of the group. I suppose this is more of a problem with how private forums work rather than just how they work with groups.

I would have thought that a private forum, like a private group, is visible to people who can't access it but they cannot see anything about topics posted in it.

Currently, I have set the forums for each of my private groups to hidden and this seems to be working correctly.

#5 @netweb
12 years ago

Related: #2130

Then in bbPress1.php check if the import is from BuddyPress Group Forums if yes grab BP's 'status'

SELECT * FROM wp_bb_forums JOIN wp_bp_groups ON (wp_bb_forums.forum_slug = wp_bp_groups.slug

#6 follow-up: @johnjamesjacoby
12 years ago

The privacy scopes in BuddyPress Groups and bbPress forums work differently. We'll need to side with one or the other, and there are pros and cons both ways.

bbPress private forums are visible by all registered members. They are private, but they aren't hidden. This means they're still visible, but access is restricted.

bbPress hidden forums are totally hidden to everyone except for moderators and keymasters. This is to allow global access to trusted forum staffers, regardless of who may have created what.

BuddyPress private groups are publicly visible, but their content is hidden until you are a group member.

BuddyPress hidden forums are completely hidden from view.


I imagine we'll want to make all forums hidden that are connected to private/hidden BuddyPress groups. That way the forums are always hidden (except to group members when accessing the group directly, global forum moderators and keymasters.)


There are also a few different methodologies at play. Since BuddyPress never previously had site-wide forums connected to group forums, there was never an issue; they were two separate platforms. Now that we're mixing them together, we may need to have two different settings: privacy, and visibility. That way a forum could be public, but not visible, or hidden, but visible in the forums listings.

Thoughts?

#7 @netweb
12 years ago

... we may need to have two different settings: privacy, and visibility.
That way a forum could be public, but not visible, or hidden, but visible in the forums listings.

I like all the things about this

#8 in reply to: ↑ 6 @aaclayton
12 years ago

I'm glad to hear this is being thought about! I would like to weigh in by suggesting that there is value in certain users having access to hidden or private forums without necessarily being capable of moderating those forums.

It would be valuable to allow for site-wide roles with the "read_hidden_forums" capability to override the lack of this permission in the participant role. This would be the preferred treatment, from my perspective. Currently it seems that Participants cannot view hidden forums regardless of the capabilities associated with their sitewide role.

Alternatively a forum role somewhere between Participant and Moderator could also suffice.

#9 @jmdodd
12 years ago

  • Cc jmdodd@… added

#10 @johnjamesjacoby
12 years ago

:snip: Wrong ticket.

Last edited 12 years ago by johnjamesjacoby (previous) (diff)

#11 @johnjamesjacoby
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4731]) When repairing BuddyPress group forum relationships, also sync up the group forum status. Fixes #2089.

@netweb
12 years ago

#12 @netweb
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#13 @johnjamesjacoby
12 years ago

(In [4744]) When updating the BuddyPress root group forum, also update the post_name. Hat tip netweb. See #2089.

#14 @johnjamesjacoby
12 years ago

ON `group`.`slug` = `forum`.`post_name`

Unfortunately you can't always rely on this. Any other ideas?

#15 @netweb
12 years ago

That's the tricky bit, finding a reliable relationship between the tables, I went with post_name as it was the best of the bunch, the only other options were forum_name & forum_desc with whitespace.

With the current bbPress1.php importer we are only importing bbPress tables, if we want any data from the BuddyPress tables so we have a reliable relationship then we have to implement something in the importer like what I did in 2089.1.diff and adding it to wp_postmeta. That will work fine for future imports but will not help anyone who has already performed an import.

The other idea I just thought of would be to put this part of the tool in BuddyPress and NOT in bbPress.

#16 @johnjamesjacoby
12 years ago

  • Milestone changed from 2.3 to 2.4

Going to move this to 2.4, so we can think about actually fixing this bit so that it can be rerun later.

#17 @netweb
12 years ago

Storing the direct SQL query I used for reference here:

SELECT `forum`.`ID`, `forummeta`.`meta_value`, `group`.`id`

FROM `wp_posts` AS `forum`

LEFT JOIN `wp_postmeta` AS `forummeta`

ON `forum`.`ID` = `forummeta`.`post_id`

AND `forummeta`.`meta_key` = '_bbp_old_forum_id'

LEFT JOIN `wp_bp_groups` AS `group`

ON `group`.`slug` = `forum`.`post_name`

WHERE `forum`.`post_type` = 'forum' AND `group`.`id` > 0

GROUP BY `forum`.`ID`;
Version 0, edited 12 years ago by netweb (next)

#18 @johnjamesjacoby
12 years ago

  • Milestone changed from 2.4 to 2.5

No time. Moving to 2.5.

#19 @netweb
11 years ago

  • Milestone changed from 2.5 to 2.6

Punting to 2.6 to see if we can find an acceptable way of linking legacy BuddyPress group forums to the bbPress1.php import process.

Have a hunch this will be something we have to implement on the BuddyPress side of things.

#20 @johnjamesjacoby
11 years ago

  • Owner set to netweb
  • Status changed from reopened to new

#21 @netweb
11 years ago

Came across this today and thought it belongs here.

WP#12706 - Custom post status bugs in the admin

Status should be used to determine the CURRENT maximum visibility of a post.
Visibility determines the absolute maximum visibility of the post.
So conceptual the question is :

current_user_can('read_post', $post_id) ;

with the answer being determined by:

$actual_visibility = max ( status_max(), visibility_max(),
<some calculation depending on current_user's relationship to the post>,
<posting_schedule>, <other filter functions > )

#22 @netweb
11 years ago

  • Keywords needs-patch removed

Migrating this ticket to BuddyPress Trac #BP5296
(this ticket can be closed and marked 'fixed' after repair tool is added to BuddyPress)

#23 @netweb
10 years ago

  • Milestone changed from 2.6 to Future Release

The bbPress repair tool bbp_admin_repair_group_forum_relationship() will repair the group forum relationships along with private and hidden forum status so long as the import of bbPress 1.x is using the same install for which BuddyPress is currently installed, effectively this is only an issue if migrating the bbPress 1.x forums to a fresh WordPress install.

Moving this to future release pending a patch with a solution that is acceptable for both plugins.

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


10 years ago

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


10 years ago

#26 @thebrandonallen
10 years ago

  • Keywords has-patch added

Adding a BuddyPress Legacy Forums converter.

@thebrandonallen
10 years ago

BuddyPressLegacy.php

This ticket was mentioned in Slack in #bbpress by thebrandonallen. View the logs.


10 years ago

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


10 years ago

Note: See TracTickets for help on using tickets.