#5087 closed defect (bug) (fixed)
BP component as front page messes up blog search
Reported by: | modemlooper | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.4 | Priority: | high |
Severity: | normal | Version: | 1.5 |
Component: | Core | Keywords: | has-patch needs-docs |
Cc: |
Description
If you have a Buddypress page set as the home page then blog search is killed because search sends you to /?s=xxx and then is searches the component instead of listing blog posts.
Not sure if this is a theme issue. Thoughts?
Attachments (1)
Change History (23)
#3
@
11 years ago
- Milestone changed from 2.0 to 2.1
- Version changed from 1.7 to 1.5
Moving to 2.1 when we can tackle this with rewrite rules.
#5
@
11 years ago
is it possible to asign this bug and give it a higher priority?, core functionality from WP is losses.
#6
@
11 years ago
The bug is already slated for the 2.1 release, so I don't think there's much good in increasing priority at this time.
As a temporary workaround, you can reconfigure your blog search to go to a blog archive page, rather than the home page URL.
#7
@
10 years ago
- Milestone changed from 2.1 to 2.2
Moving to 2.2 with the rest of the other rewrite rule-related tickets.
#9
@
9 years ago
- Priority changed from normal to high
Does anyone know a work-around for this? It doesn't appear that a bug fix is imminent.
Seeing how this keeps getting kicked down the road, I'd like to echo @mth75 and ask that the priority of this be raised. Having the Activity page as the homepage of my community was much better for promoting engagement, but then I discovered that it was breaking search and had to put it back to a static homepage. :(
#10
@
9 years ago
- Keywords has-patch added
- Milestone changed from Future Release to 2.4
5087.diff is a suggested strategy. It does the following:
- When parsing URIs, bail on URLs like
example.com/?s=foo
if a BuddyPress component page is set to 'page_on_front'. - The check has to go late in the
catchuri()
function, because we need to be able to detectcurrent_action
in order to allowexample.com/members/boone/activity?s=foo
to continue to work whenmembers
is the front page. Not terribly elegant, but it gets the job done. - The change will break directory search boxes. I changed the default Members directory search form so that the search term is in
$_GET['members_s']
instead of$_GET['s']
. The same fix would have to be applied to the other components (mainly groups, since Activity doesn't have a native search box).
The downsides of this approach, as I see them, are:
- Any custom search forms or other routers that direct traffic to
[member_directory_url]?s=foo
will break in cases where the front page is set to the member directory. This is definitely a corner case, but worth considering. - The URL
example.com/?member_s=foo
is not very attractive. I'm open to better ideas for the URL param. For pagination we useapage
for activity, etc - maybemsearch
is better, though it's equally untranslatable.
I think what I'm suggesting here is imperfect, but better than the current state of affairs. Anyone have thoughts about it?
#12
@
9 years ago
- Keywords 2nd-opinion removed
Circling back around to this. The query arg 'members_s' is ugly, and doesn't allow for translation. So I'm going to add a layer of abstraction, so that components can register their own 'search_query_arg'. We'll make this the reasonably attractive 'members_search', 'groups_search', etc in core, and plugins/sites can filter if they want.
#13
@
9 years ago
- Owner set to boonebgorges
- Resolution set to fixed
- Status changed from new to closed
In 10110:
#14
@
9 years ago
- Keywords needs-docs added
Noting here that when we update the codex release note for 2.4, we should note that the parameter has been changed in case anyone has hardcoded links.
Somewhat of a known issue, though not documented. It's because the search query string is globally the same, all of them listening for 's' instead of their own. We started working around this is a few places, but it's likely that it never was finished.
Moving to 1.9 to think about how to solve this later, possibly related to rewrite rules.