Skip to:
Content

BuddyPress.org

Changeset 9914


Ignore:
Timestamp:
06/04/2015 01:14:46 PM (9 years ago)
Author:
boonebgorges
Message:

Allow Members directory pages to be nested under other pages.

A bug was introduced in [9723] that broke the way that URIs are parsed when
viewing a Members directory page, when that page is the child of another
WP page.

Props r-a-y.
See #6475.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-catchuri.php

    r9819 r9914  
    316316                    $bp->current_component = '';
    317317                }
    318             }
    319 
    320             // Reset the offset
    321             $uri_offset = 0;
     318
     319                // Reset the offset
     320                $uri_offset = 0;
     321            }
    322322        }
    323323    }
  • trunk/tests/phpunit/testcases/routing/members.php

    r9819 r9914  
    2828        $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) );
    2929        $this->assertTrue( bp_is_my_profile() );
     30    }
     31
     32    /**
     33     * @ticket BP6475
     34     */
     35    public function test_member_directory_when_nested_under_wp_page() {
     36        $p = $this->factory->post->create( array(
     37            'post_type' => 'page',
     38            'post_name' => 'foo',
     39        ) );
     40
     41        $members_page = get_page_by_path( 'members' );
     42
     43        wp_update_post( array(
     44            'ID' => $members_page->ID,
     45            'post_parent' => $p,
     46        ) );
     47
     48        $members_page_permalink = bp_get_root_domain() . '/foo/members/';
     49        $this->go_to( $members_page_permalink );
     50
     51        $this->assertTrue( bp_is_members_component() );
     52        $this->assertEquals( '', bp_current_action() );
    3053    }
    3154
Note: See TracChangeset for help on using the changeset viewer.