Opened 10 years ago
Closed 6 years ago
#6178 closed defect (bug) (fixed)
"Create new site" link in WPMU redirecting to homepage
Reported by: | yosmc | Owned by: | imath |
---|---|---|---|
Milestone: | 4.3.0 | Priority: | normal |
Severity: | normal | Version: | 2.0.3 |
Component: | Blogs | Keywords: | has-patch commit |
Cc: |
Description
Seems like this bug has been around for years: In a multisite environment, when users are allowed to create additional subsites, activating Buddypress breaks this function. In the dashboard, when you click on "my sites" -> "create new sites" the logged-in user never arrives at the form to actually create a new site, but is redirected to the homepage instead.
PROPOSED FIX - in bp-members-function.php find this (line 2069):
if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) ) {
REPLACE WITH:
if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && ( 'register' != $action ) ) {
That way, new registrations are forwarded to the Buddypress form, while "create new site" is handled by WP Core.
Attachments (5)
Change History (21)
#2
@
10 years ago
This is the kind of situation that would almost make the blogs component a "mu-component".
Applying the 6178.patch should fix the issue reported by yosmc, but then 2 registrations process are "co-existing". There might be no problem at all, but we should really test using both ways to be sure.
#3
@
10 years ago
- Milestone changed from Awaiting Review to 2.3
Thanks, imath. I don't think it's a huge problem for there to be two different registration processes. It's not as if BP itself is maintaining two separate processes. Instead, we have a blog creation process that we sometimes disable.
Regarding the "mu-component" suggestion: it strikes me that perhaps the "create a site" page should, indeed, always be enabled, but that the blog tracking component doesn't seem like it should be always-on. Perhaps site creation shouldn't be part of the blogs component? Just a thought.
#4
@
10 years ago
Sorry for the late reply - I thought I would receive automatic notifications for this ticket, but apparently, I don't.
I did not have Site Tracking enabled - when I do enable it, the link to create new sites indeed tries to take me to a page at blogs/create/ which, however doesn't exist. This opens a whole bag of mysteries to me (like why enabling a tracking option would change link locations, or why the new link location doesn't exist, or how to rename the link as the subsites I am creating aren't blogs).
Also there seems to be two schools of thought in this ticket, either that enabling Site Tracking is the way to go or that a patch is needed. Since enabling Site Tracking seems to lead to all kinds of sub-problems that need to be solved as well, I am leaning towards the patch, but at the end of the day I will go with the recommended fix.
#5
@
9 years ago
- Component changed from API - Sign ups & Activation to Component - Blogs
- Keywords early added
- Milestone changed from 2.3 to 2.4
As we will be working on the blogs component during 2.4 dev-cycle, i'm moving the ticket to this milestone.
#7
@
9 years ago
- Keywords has-patch added
- Milestone changed from Future Release to 2.6
Actually i think the problem here is due to the fact arguments used in strpos
need to be inversed. 6178.2.patch is doing so, it's then possible to display the wp-signup.php page to let Users create new sites even if the blogs component is not active.
#8
@
9 years ago
- Keywords commit added
@imath I don't know if that patch will fix this issue, but I agree with you it looks like it is the wrong way around.
#9
@
9 years ago
- Owner set to imath
- Resolution set to fixed
- Status changed from new to closed
In 10665:
#10
@
6 years ago
- Keywords early has-patch commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
#11
@
6 years ago
- Keywords has-patch 2nd-opinion added
- Milestone changed from 2.6 to 4.3.0
6178.3.patch :
- brings back the
wp-signup.php
redirection by default. - if the blogs component is not active, it adds an exception, to allow
wp-signup.php
so that new sites can still be added.
#12
@
6 years ago
Thanks, @imath. 6178.4.patch makes the following changes:
- Simplify the logic to bail early if this is not a wp-signup.php request.
- Rename some variables to prevent double-negatives :)
- When clicking on Add New from my-sites.php and Blogs *is* active, redirect to the BP site creation page instead of /register/ (which goes back to home for logged-in users)
Could you review to make sure I've properly captured the spirit of the ticket?
#13
@
6 years ago
Thanks a lot @boonebgorges You captured it :)
There's just one thing I'm wondering. The redirection is also checking for the registration url of regular WordPress site :
wp-login.php?action=register
So I wonder if we could check the $_GET['action']
earlier.
#14
@
6 years ago
Ah, thanks for that. If we're specifically checking for wp-login.php?action=register
, we should not be doing a blanket check for action=register
on any page. In this kind of case, it's better to be explicit than to be concise. I've updated the patch accordingly.
Do you have the Blogs component (Site Tracking) enabled? If so, you should be taken to BP's native "Create a Site" page.
If not, we ought to be checking whether Blogs is enabled before hijacking this link.