Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 10 years ago

#5512 closed enhancement (fixed)

Don't allow non-root blog admins to use the Friends widget

Reported by: lenasterg's profile lenasterg Owned by: boonebgorges's profile boonebgorges
Milestone: 2.1 Priority: normal
Severity: normal Version: 1.9
Component: Friends Keywords: has-patch
Cc: brad@…

Description

In a multisite installation all the buddypress widgets are available for all blogs.
But the BP_Core_Friends_Widget is specific for use in a Buddypress page.
This can cause many headache to a multisite helpdesk support person :-).

There is a paid plugin which allow to hide specific widgets from non main blogs, but isn't it something that the Buddypress should self check?

Attachments (1)

bp-friends.patch (426 bytes) - added by williamsba1 10 years ago.
Only register the Friends widget on the main site

Download all attachments as: .zip

Change History (9)

#1 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 2.1
  • Summary changed from Buddypress BP_Core_Friends_Widget and multisite to Don't allow non-root blog admins to use the Friends widget
  • Version changed from 2.0 to 1.9

But the BP_Core_Friends_Widget is specific for use in a Buddypress page.

If I understand this correctly, you mean that the Friends widget can be used everywhere, but it doesn't really work everywhere, because it depends on the existence of a displayed user, which only occurs on the main site?

If that's correct, then yes, this is a good observation. We already explain in the widget description that "Widget is only shown when viewing a member profile", which suggests that it won't work on subsites. But your idea of not showing it at all does make sense. Let's look at this for 2.1.

#2 @boonebgorges
11 years ago

  • Keywords needs-patch added

#3 @espellcaste
11 years ago

I understood this differently.

It appears he'is saying that the BuddyPress Widgets is showing in ALL the blogs in the network, something that I also think should not be the default behavior.

Maybe if installed Network-wide, it appears in all the blogs.

#4 @boonebgorges
11 years ago

It appears he'is saying that the BuddyPress Widgets is showing in ALL the blogs in the network, something that I also think should not be the default behavior.

Maybe if installed Network-wide, it appears in all the blogs.

You might be right that this was the original intention. However, it's worth noting that (a) the widgets do only appears networkwide if BP is network activated, and (b) most of the widgets (like, say, the Groups widget) work fine on any blog in the network. It's only the Friends widget that fundamentally breaks in cases where you're not looking at the root blog. The fact that the widgets work in these cases makes me think there's no harm in providing them to subblogs.

#5 @lenasterg
11 years ago

Hi.
Sorry for my bad English. I meant what boonebgorges is saying:

"...Friends widget can be used everywhere, but it doesn't really work everywhere, because it depends on the existence of a displayed user, which only occurs on the main site."

In a multisite installation where the Buddypress is used only in the main blog, and the other blog owners are seeing the widget in their Widgets admin area, tend to drag it to the panel ignoring the widget's description.

It's minor that I thought I should report it.

@williamsba1
10 years ago

Only register the Friends widget on the main site

#6 @williamsba1
10 years ago

  • Cc brad@… added
  • Keywords has-patch added; needs-patch removed

Added a patch that only registers the Friends widget on the main site in a network. On a single WordPress install the widget will always register and on a Multisite install the widget will only register on the main site. This should eliminate any confusion on what site the widget can be used on.

#7 @boonebgorges
10 years ago

Awesome, thanks, williamsba1. is_main_site() isn't quite specific enough for BP - we need to use bp_is_root_blog() to support the installation of BP on a secondary site, as well as multiblog mode. But the logic looks good to me.

#8 @boonebgorges
10 years ago

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

In 8299:

Don't register the Friends widget on non-root blogs

This widget only works in the context of displayed users, which do not exist
outside of root blogs.

Fixes #5512

Props williamsba1

Note: See TracTickets for help on using tickets.