Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#5721 closed defect (bug) (fixed)

Members directory displaying on more than one page.

Reported by: xhan Owned by: johnjamesjacoby
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)

5721.patch (1003 bytes) - added by pro120 5 years ago.
Remove page template fallback check

Download all attachments as: .zip

Change History (8)

#1 @boonebgorges
5 years ago

  • Milestone changed from Awaiting Review to 2.1

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.)

#2 @DJPaul
5 years ago

  • Priority changed from normal to high

Confirmed.

#3 @DJPaul
5 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 @DJPaul
5 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.

@pro120
5 years ago

Remove page template fallback check

#5 @pro120
5 years ago

Looks like this was most likely a legacy concern that is improperly matching standard page templates.

#6 @johnjamesjacoby
5 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.

Last edited 5 years ago by johnjamesjacoby (previous) (diff)

#7 @johnjamesjacoby
5 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 9091:

Remove page template name check in bp_is_current_component() introduced in r3884, fixing potential collisions causing unexpected template output or redirections.

Props pro120. Fixes #5721.

Note: See TracTickets for help on using tickets.