Skip to:
Content

BuddyPress.org

Opened 8 months ago

Closed 4 months ago

Last modified 4 months ago

#8932 closed defect (bug) (fixed)

Make sure to display a 404 if a Members (sub)nav misses a valid screen function

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 12.0.0 Priority: normal
Severity: normal Version:
Component: Members Keywords: has-patch
Cc:

Description

Working on documenting the BP_Component class, I noticed the BP Rewrites API wasn't displaying a 404 if a plugin was adding a members nav/subnav without a valid screen function. The Legacy URL parser was doing this fine.

To maintain this behavior in 12.0.0, we need to check the parsed query once the Members primary/secondary navigations are set to verify the current Members’ component action has a valid screen function.

Change History (8)

This ticket was mentioned in PR #125 on buddypress/buddypress by @imath.


8 months ago
#1

  • Keywords has-patch added; needs-patch removed

Displaying a 404 if a Members (sub)nav misses a valid screen function is preserving what was happening in this case with the BP Legacy URL parser.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8932

#2 @imath
8 months ago

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

In 13512:

Check the requested Member’s page matches a valid nav screen function

The BP_Members_Component::check_parsed_query() method happens once the query is parsed & once the single displayed Member's navigation is set. It checks the current action matches a navigation slug & whether the corresponding screen function exists and is callable. If it's not the case a 404 is displayed, just like it's currently the case when the BP Legacy URL parser is in use.

See #4954
Fixes #8932
Closes https://github.com/buddypress/buddypress/pull/125

#3 @imath
7 months ago

In 13534:

Restore the Member’s activity single view

A regression introduced in [13512] was preventing single activities to successfully load into the BP Nouveau Template Pack. We need to only perform the parse query check when viewing a single user. In the case of a single activity there is no need to check for an existing Member’s (sub)navigation item.

See #8932
Fixes #8956
Closes https://github.com/buddypress/buddypress/pull/143

#4 @imath
4 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#5 @imath
4 months ago

  • Keywords needs-patch added; has-patch removed

BP_Members_Component::check_parsed_query() is not taking care of not existing Member's main nav. In this case it should display a 404.

This ticket was mentioned in PR #179 on buddypress/buddypress by @imath.


4 months ago
#6

  • Keywords has-patch added; needs-patch removed

This case wasn't taken in account into previous patch/fix.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8932

#7 @imath
4 months ago

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

In 13621:

Improve 404 management in BP_Members_Component::check_parsed_query()

  • Make sure to do a 404 if corresponding Members primary navigation does not exist.
  • Take in account Members navigations not generated by a BP Component.

Fixes #8932

Note: See TracTickets for help on using tickets.