Opened 12 years ago
Closed 7 years ago
#6178 closed defect (bug) (fixed)
"Create new site" link in WPMU redirecting to homepage
| Reported by: | yosmc | Owned by: | imath |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3.0 |
| Component: | Blogs | Version: | 2.0.3 |
| Severity: | normal | 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
@
12 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
@
12 years ago
- Milestone Awaiting Review → 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
@
12 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
@
11 years ago
- Component API - Sign ups & Activation → Component - Blogs
- Keywords early added
- Milestone 2.3 → 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
@
10 years ago
- Keywords has-patch added
- Milestone Future Release → 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
@
10 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.
#11
@
7 years ago
- Keywords has-patch 2nd-opinion added
- Milestone 2.6 → 4.3.0
6178.3.patch :
- brings back the
wp-signup.phpredirection by default. - if the blogs component is not active, it adds an exception, to allow
wp-signup.phpso that new sites can still be added.
#12
@
7 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
@
7 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
@
7 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.