Skip to:
Content

BuddyPress.org

Opened 4 years ago

Last modified 3 years ago

#6731 new defect (bug)

search as page/post slug redirects to home

Reported by: modemlooper Owned by:
Milestone: Awaiting Contributions Priority: high
Severity: normal Version: 2.2
Component: Core Keywords: needs-patch
Cc:

Description

Create a page ona site with BP active and the page gets redirected to home.

Introduced here:
https://buddypress.trac.wordpress.org/changeset/10110

Change History (11)

#1 @modemlooper
4 years ago

Create a page on a site with slug "search" BP active and the page gets redirected to home.

#2 @boonebgorges
4 years ago

  • Keywords reporter-feedback added

Looking at this more closely, I think [10110] is unrelated. I'm fairly sure this dates back to [3490]. See #2710. I managed to reproduce on 2.3.x and 2.2.x, though I'd wager it goes back to 1.5.

The issue is this: BP's directory searches use AJAX. The no-js fallback is to send requests to /search/, at which point bp_core_action_search_site() grabs the request and reroutes it. This means that it's not possible to have a page called /search/ on a BP installation.

FWIW I think this is pretty crummy. There's no reason why we need to steal a pretty permalink for this purpose. We should just send search requests to bp_get_root_domain(), with $_POST['bp-is-search'] = 1 or something like that.

If you can verify that this is not a new problem, we'll fix this for 2.5.

#3 @modemlooper
4 years ago

why not change

define( 'BP_SEARCH_SLUG', 'search' );

to

define( 'BP_SEARCH_SLUG', 'bp-search' );

#4 @boonebgorges
4 years ago

Yeah, that'd require less of a change. But it just mitigates the problem, instead of eliminating it. It's an abuse of the URL parser that we are doing this in the first place.

Did you get a chance to verify against an earlier version of BP?

#5 @DJPaul
4 years ago

If the search handling in bp_core_set_uri_globals is changed however this is fixed, please also see https://buddypress.trac.wordpress.org/ticket/6325#comment:5

#6 @r-a-y
4 years ago

  • Keywords reporter-feedback removed
  • Milestone changed from 2.4.1 to 2.5

This is not a regression.

Tested on BP 2.3.4 and it happens there as well.

#7 @DJPaul
4 years ago

  • Milestone changed from 2.5 to 2.6

#8 @DJPaul
4 years ago

  • Milestone changed from 2.6 to Future Release

#9 @slaFFik
3 years ago

  • Milestone changed from Future Release to 2.8
  • Version changed from 2.4.0 to 2.2

Still valid for BuddyPress 2.7.2.
Although this is not a blocker, as people on forum seems not complaining about it (I didn't find), I would like to provide a fix in 2.8.

#10 @slaFFik
3 years ago

Related: #2767

#11 @DJPaul
3 years ago

  • Milestone changed from 2.8 to Future Release
Note: See TracTickets for help on using tickets.