Opened 11 years ago
Closed 10 years ago
#5721 closed defect (bug) (fixed)
Members directory displaying on more than one page.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.2 | Priority: | high |
Severity: | normal | Version: | 1.2.8 |
Component: | Core | Keywords: | |
Cc: |
Description
Steps to reproduce:
Create page template, name the file page-membership-application.php
Any page using this template will load the membership directory.
Cause:
bp-core-template.php is searching for the word 'members' assumes users wont have other page templates with the word members in it.
line 1114
if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
I've not tested this too thoroughly as I haven't had time so for now I've just renamed my template page-mem-application.php
Attachments (1)
Change History (8)
#3
@
11 years ago
Dates way back to r3884: "to look for page templates as root_slug's too".
@JJJ: can you take a look at this please?
#4
@
11 years ago
- Milestone changed from 2.1 to 2.2
- Version changed from 2.0 to 1.2.8
Let's pull out strstr early in 2.2 to give us time to see if we can re-discover the edge case, or if JJJ can remember any more details why this change was made.
#5
@
10 years ago
Looks like this was most likely a legacy concern that is improperly matching standard page templates.
#6
@
10 years ago
Patch looks good. It fixes both the original bug, and another redirect issue related to more recent changes to theme compatibility template handling.
I'll add that after looking at the original changeset, I agree it doesn't really make much sense, and am unclear exactly what problem it was trying to solve, so I'm comfortable basically reverting that part of r3884 and circling back with more details later.
Moving to 2.1 for a further look. Using
strstr()
in this way seems really odd to me, so someone should have a look to see why this check was introduced in the first place. (It could be a legacy concern that's no longer relevant.)