Opened 10 years ago
Closed 10 years ago
#5898 closed defect (bug) (fixed)
Unable to page through search results
Reported by: | bomako | Owned by: | imath |
---|---|---|---|
Milestone: | 2.1.1 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Members | Keywords: | has-patch commit |
Cc: | mvferguson@… |
Description
I am using WordPress 3.9.2 and BuddyPress 2.1. I have a custom field for a building name where people live. The sample values are "~ Aspen ~", "~ Park Manor ~", "~ Duplex Homes ~". Each member has something selected. If I go to the member page and click on the link of their building name, I am taken to a URL ending with (for example) "?s=~+Cottage+Homes+~" and the search results are loaded. But when I try to paginate through those results, the URL changes to "?upage=2&s=~CottageHomes~" and I get a message saying "Sorry, no members were found." It appears that all the spaces are stripped from the search. If I insert the spaces in the URL, the second page displays members just fine.
Attachments (5)
Change History (16)
#1
@
10 years ago
- Component changed from Core to Members
- Keywords dev-feedback has-patch added
- Milestone changed from Awaiting Review to 2.1.1
This ticket was mentioned in IRC in #buddypress-dev by bgorges. View the logs.
10 years ago
#3
@
10 years ago
Worked on a unit test. And it made me edit my previous patch ;)
See 5898-02.patch & 5898-02-unittest.patch
#4
follow-up:
↓ 5
@
10 years ago
Thanks, imath! Couple notes on the test:
- Could you make the method name a bit more descriptive? Maybe
test_bp_has_members_search_pagination_with_spaces()
- Should be
@ticket BP5898
- Clean up the
$members_template
global or you may pollute later tests
#5
in reply to:
↑ 4
@
10 years ago
Replying to boonebgorges:
Thanks, imath!
You're welcome ;)
Applied your notes in 5898-03-unittest.patch except for @ticket BP5898
as for some weird reason, the test is skipped in this case. So i've used @ticket bp5898
instead.
#6
@
10 years ago
except for @ticket BP5898 as for some weird reason, the test is skipped in this case. So i've used @ticket bp5898 instead.
This is by design - tests that are associated with open tickets are skipped, unless (a) you run them explicitly (phpunit --group BP5898
) or (b) you define WP_TESTS_FORCE_KNOWN_BUGS
as true in wp-tests-config.php. The fact that the test was being skipped when running phpunit
means that you had the annotation correct :)
Also, forgot to mention in my last comment - don't check ! empty( $matches[1] )
. You're doing that to avoid PHP notices, which is good practice in BuddyPress, but in a unit test, we want to see the error when your regex doesn't match anything so we know that the test has failed!
#7
@
10 years ago
Well phpunit --BP5898 was also skipping the test. Updated the unittest, thanks a lot for the explanations ;)
#8
@
10 years ago
- Keywords commit added; dev-feedback removed
phpunit --group BP5898
:)
Thanks for the fixes!
Hi bomako
Thanks for your feedback. It seems to be a side effect of r8928. I suggest the attach patched.
BTW, i was wondering if there were a specific reason why in the member's dir search form, the search term was displayed as a placeholder instead of the input value ?