"Exact user search" doesn't work intuitively with names containing spaces
Bug #1612481 reported by
Dmitrii Metelkin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Steps to replicate:
Make sure that the setting "Exact user searches" set to Yes on admin/extension
Create a user with multi word lastname, e.g Bla Bla Bla
Navigate to /admin/
Type this in search form:
Bla Bla Bla
Expected result: User is in the search results, because you've typed their exact last name.
Actual result: User is not in the search results
Workaround: Enclose the firstname and/or lastname *by itself* in double quotes. e.g., for the user Aaron von Wells, search for:
Aaron "von Wells"
description: | updated |
Changed in mahara: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
description: | updated |
summary: |
- In some cases users are out of the search result on admin page + "Exact user search" doesn't work intuitively with names containing + spaces |
description: | updated |
To post a comment you must log in.
The problem is the Mahara code expects firstname and lastname to be 1 word each
See searchlib.php
line 137:
if (count($phraselist) == 2) {
and
$constraints[ ] = array(
' field' => 'firstname',
' type' => 'contains',
' string' => $n[0]
$constraints[ ] = array(
' field' => 'lastname',
' type' => 'contains',
' string' => $n[1]
line 198:
foreach ($fullnames as $n) {
);
);
}
So if you were to search for something like 'Schnitzel von Krumm' it would not work
To fix this we could check all combinations of the words as fullnames when there are more than 2 words eg
| Schnitzel von | Krumm |
| Schnitzel | von Krumm |