Skip to:
Content

Opened 17 months ago

Last modified 3 months ago

#2089 new defect

BuddyPress: bbPress1 importer doesn't check BP group status

Reported by: r-a-y Owned by: netweb
Milestone: 2.6 Priority: normal
Severity: major Version: 2.2
Component: Importers Keywords:
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 16 months ago.
2089.2.diff (1.8 KB) - added by netweb 15 months ago.

Download all attachments as: .zip

Change History (24)

comment:1 netweb16 months 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 16 months ago by netweb (previous) (diff)

netweb16 months ago

comment:2 johnjamesjacoby16 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.

comment:3 netweb16 months 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.

comment:4 NickMackz16 months 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.

comment:5 netweb16 months 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

comment:6 follow-up: johnjamesjacoby16 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?

comment:7 netweb16 months 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

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

comment:9 jmdodd16 months ago

  • Cc jmdodd@… added

comment:10 johnjamesjacoby15 months ago

:snip: Wrong ticket.

Last edited 15 months ago by johnjamesjacoby (previous) (diff)

comment:11 johnjamesjacoby15 months 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.

netweb15 months ago

comment:12 netweb15 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:13 johnjamesjacoby15 months ago

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

comment:14 johnjamesjacoby15 months ago

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

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

comment:15 netweb15 months 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.

comment:16 johnjamesjacoby15 months 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.

comment:17 netweb14 months 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`;
Last edited 7 months ago by netweb (previous) (diff)

comment:18 johnjamesjacoby11 months ago

  • Milestone changed from 2.4 to 2.5

No time. Moving to 2.5.

comment:19 netweb5 months 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.

comment:20 johnjamesjacoby5 months ago

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

comment:21 netweb4 months 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 > )

comment:22 netweb3 months 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)

Note: See TracTickets for help on using tickets.