[buddypress-trac] [BuddyPress Trac] #6307: Friend request link returns 404 error if user is not logged into website
buddypress-trac
noreply at wordpress.org
Mon Mar 23 13:45:27 UTC 2015
#6307: Friend request link returns 404 error if user is not logged into website
---------------------------------+-----------------------------
Reporter: wrowlands | Owner: dcavins
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: Future Release
Component: Component - Friends | Version: 1.0
Severity: normal | Resolution:
Keywords: needs-patch |
---------------------------------+-----------------------------
Changes (by boonebgorges):
* keywords: 2nd-opinion => needs-patch
* milestone: Under Consideration => Future Release
Comment:
dcavins - Right, I forgot that we handled this more elegantly in
`BP_Group_Extension`.
The crux of the issue here is 'user_has_access':
https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-friends
/bp-friends-loader.php?marks=156#L139 When this is set to false,
`bp_core_new_nav_item()` will simply bail before registering the nav item
or the screen callback
https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-core/bp-
core-buddybar.php?marks=84,85#L79 A more elegant solution may be to detect
that this is a page that requires a logged-in user, and to redirect to wp-
login.php as appropriate. I'm not sure if this would work generally,
though, since 'user_has_access' is used in a number of different ways
throughout BP and BP plugins.
This is also closely related to #6301 and the intertwingledness of the way
that nav items and screen callbacks are registered. If the two were
separate, the puzzle would be easier to solve.
In the meantime, I don't see any harm in going with my suggestion
https://buddypress.trac.wordpress.org/ticket/6307#comment:2. This is a
targeted fix that shouldn't have any broader implications.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6307#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list