Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/25/2014 10:01:45 PM (11 years ago)
Author:
imath
Message:

On members directory, make sure search terms containing spaces are well transported in pagination links.

When a profile field output containing spaces was clicked, the member search functionality wasn't creating consistent pagination links. This behavior was introduced by r8928. Patch is fixing the issue and also includes a unit test.

props boonebgorges

Fixes #5898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/template.php

    r8958 r9045  
    3939
    4040        $this->assertEquals( $user_ids, $shouldbe );
     41    }
     42
     43    /**
     44     * @ticket BP5898
     45     * @group bp_has_members
     46     */
     47    public function test_bp_has_members_search_pagination_with_spaces() {
     48        $u1 = $this->create_user( array( 'display_name' => '~ tilde u1' ) );
     49        $u2 = $this->create_user( array( 'display_name' => '~ tilde u2' ) );
     50
     51        $template_args = array(
     52            'search_terms' => '~ tilde',
     53            'per_page'     => 1,
     54        );
     55
     56        global $members_template;
     57        $reset_members_template = $members_template;
     58
     59        bp_has_members( $template_args );
     60
     61        preg_match( '/&s=(.*)\'/', $members_template->pag_links, $matches );
     62
     63        $this->assertEquals( urldecode( $matches[1] ), urldecode( $template_args['search_terms'] ) );
     64
     65        // reset the members template global
     66        $members_template = $reset_members_template;
    4167    }
    4268
Note: See TracChangeset for help on using the changeset viewer.