Skip to:
Content

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#4032 closed defect (bug) (fixed)

bp_get_signup_slug broken in multisite configurations

Reported by: zephod Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

This function will create a link to /register on subsites, which does not exist -- it needs to point back to the main site.

For example, see http://openeconomics.net. The link on the right sidebar should point to the /register page under the http://okfn.org domain (core of the multisite).

Change History (9)

comment:1 zephod2 years ago

  • Summary changed from bp_get_members_slug broken in multisite configurations to bp_get_signup_slug broken in multisite configurations

comment:2 boonebgorges2 years ago

  • Keywords reporter-feedback added

Hm. Can you give an example of where incorrect links are being created on subsites? I ask because it seems to me that it's not bp_get_signup_slug() that's broken - 'register' is, indeed, the correct slug - but that the wrong code is being used to generate the 'create an account' link on http://openeconomics.net. Did you code that login widget yourself?

The correct way to construct that link would
$href = trailingslashit( bp_get_root_domain() . '/' . bp_get_signup_slug() );

comment:3 zephod2 years ago

Thanks boonebgorges: I was just realising that myself. However, that isn't a sidebar login widget coded by me; it is inherited from the bp default theme.

bp-default/sidebar.php should not wrap the link in site_url() when using a multisite configuration:

<?php printf( ( 'Please <a href="%s" title="Create an account">create an account</a> to get started.', 'buddypress' ), site_url( bp_get_signup_slug() . '/' ) ) ?>

comment:4 zephod2 years ago

  • Keywords reporter-feedback removed

comment:5 boonebgorges2 years ago

I think the problem is that BuddyPress doesn't expect you to use child themes of bp-default on the non-root blog - generally, there's no need to have BP compatibility on a blog other than the main BP blog. (I guess this gets more complicated if you're using BP_ENABLE_MULTISITE.)

Anyway, I think you're right that this should be fixed to point to the root blog.

comment:6 zephod2 years ago

That is unfortunate - we've been refactoring the mess of themes in the okfn.org network of (50+) sites, and I'm trying to get everybody to standardise on my core theme. Which so happens to be a child theme of bp-default, to minimise development overhead and remain as futureproof as possible. Did I make a wrong turn somewhere?

(Theme code is available here: https://github.com/okfn/wordpress-theme-okfn .. as you can see, it's pretty minimal).

comment:7 boonebgorges2 years ago

  • Milestone changed from Awaiting Review to 1.6

I think it's fine to do that, it's just not what bp-default expects.

comment:8 boonebgorges2 years ago

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

(In [5824]) Use bp_get_signup_page() when constructing the 'create an account' link in the bp-default sidebar.
Prevents incorrect registration links when using the login widget on non-root blogs.
Also added some PHPDoc.
Fixes #4032.

comment:9 boonebgorges2 years ago

OK, that will fix it for bp-default in BP 1.6, which I hope will be out soon. If you're having problems in the meantime, just put a patched sidebar.php into your bp-default child theme (which you can then remove when BP 1.6 comes out if you'd like).

Cool site, by the way! (from a recovering academic)

Note: See TracTickets for help on using tickets.