Friend request – wp-login redirects?

I am testing my site and if a user does a friend request the other person gets sent the request. When they click on the link, if they are not already logged into the site instead of going to a wp-login.php? its goes to a wp-login.php?redirect_to= and then says page not found. Please could anyone tell me how to solve this. Its the latest version of Buddypress.

Are there any errors in your server’s error logs? Do you have any plugins activated besides BuddyPress? If so, deactivate them all and see if the issue resolves. Also, please continuing using the default theme as we troubleshoot this issue.

I have no ideas but I am getting the same type of problem with WP 3.0.1 BP1.2.5.2. When a new user is registered by the admin, via the “add user” option on the users page, an auto email is sent. When the new user clicks on the link they get redirected to wp-login.php. What make this a major problem is that they have not yet been assigned a password so there is no way for them to confirm their existing registration and no way for them to register themselves with the same email address until the first email registration expires (2 days i think).

This wasn’t happening to me at first with the same set up. The new user would enter the site. But I’m unsure if they couldn’t leave without being assigned an avatar and selecting a password?

I’ve experienced this problem as well, here is my work around. This fixes my particular grief with this defect, but is not particularly kosher (modifying core plugin files, be careful with your updates) so your mileage may vary.

In /wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php edit the variable $all_requests_link on line 14. This is the link sent in your friend requests e-mail that breaks if you are not logged in.

What you will attempt to do now is change this variable to include /wp-login.php?redirect_to=the_link_you_want_to_login_redirect to. reauth=1 is added in case the person is logged in, they will be redirected to the correct place also and not bypassed.

I was having this same problem and posted a lengthy comment about it in the trac ticket mentioned above ( https://trac.buddypress.org/ticket/2647 ), but in the meantime, I developed a workaround that works on my site and doesn’t require modifying any core files (and will fix the problem in any BP component, not just with friend request emails).

It’s not a good permanent solution, but I haven’t noticed it affecting anything else (including BP 404s) on my site, and it leaves your BP install happily untouched. If the issue is fixed in the future, of course, I would highly recommend removing this fix, but as far as I can tell, it’s harmless, and certainly makes your site far more usable.