Opened 5 months ago

Last modified 3 months ago

#2089 reopened defect

BuddyPress: bbPress1 importer doesn't check BP group status

Reported by: r-a-y Owned by:
Priority: normal Milestone: 2.4
Component: Importers Version: 2.2
Severity: major Keywords: needs-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 (2)

2089.1.diff (15.6 KB) - added by netweb 5 months ago.
2089.2.diff (1.8 KB) - added by netweb 4 months ago.

Download all attachments as: .zip

Change History (19)

  • 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 5 months ago by netweb (previous) (diff)

netweb5 months 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.

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.

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.

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

comment:6 follow-up: ↓ 8   johnjamesjacoby5 months 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?

... 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

comment:8 in reply to: ↑ 6   aaclayton5 months 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.

  • Cc jmdodd@… added

:snip: Wrong ticket.

Last edited 4 months ago by johnjamesjacoby (previous) (diff)
  • 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.

netweb4 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

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

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

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.

  • 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.

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`;
Note: See TracTickets for help on using tickets.