usersearch doesn´t work with multibyte-characters on SolarisOS

Bug #1841571 reported by Matthias Ermeling
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Cecilia Vela Gurovic

Bug Description

Mahara 18.04.0, 18.04.2 and 19.04.0
OS: Solaris 10
Postgres-database
Browser: Chrome 76, Firefox 60.7.0

The User-Search doesn´t work with Multibyte-Characters (like ä, ö, ü, ß) within the searchterm under Solaris 10 Operating System.

Solution is to change the strtolower()-funtion to mb_strtolower() in the searchlib.

description: updated
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Matthias,

Thanks for reporting this. Since you know what needs to be done, do you want to provide a patch and either upload it here or submit into code review at https://reviews.mahara.org (instructions of connecting are at https://wiki.mahara.org/wiki/Developer_Area/Contributing_Code )?

Solaris is not a supported operating system by the Mahara project. However, if it doesn't have a negative impact, the change can be looked into.

Thanks
Kristina

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11071

Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 20.10.0
importance: Undecided → Medium
status: New → In Progress
Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :

This is actually not only a problem in SolarisOS. I could replicate on master in my local instance in Ubuntu 16.04 using a postgres DB.

The fix proposed here works for Elastic Search, I suppose they have this type of search set up on the site.

But this is also happening when using internal search, so we need to fix the other half of the problem as well.

Testing

This affects the user search (admin section user search and group user search)

The steps I followed for Elastic Search:

- Set up elasticsearch
- Create a user with first name: PINGÜINO, last name: Person
- might need to wait for the cron to index the changes, or run the cron manually lib/cron.php
- Go to Admin menu->People->People search
- Search for PINGÜINO

Expected result: The user is listed in the results
Actual restult: the user is not listed in the results

After changing the function from strtolower to mb_strtolower on searchlib.php file, the issue is fixed for elasticsearch.

The steps I followed for internal search:

- In Site options -> search settings change the search plugin to internal and save
- Go to Admin menu->People->People search
- Search for PINGÜINO

Expected result: The user is listed in the results
Actual restult: the user is not listed in the results

The tests are similar for group search.

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/11072

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11071
Committed: https://git.mahara.org/mahara/mahara/commit/c89b52dd9c56721b44ffd15e44734a401245d9a8
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit c89b52dd9c56721b44ffd15e44734a401245d9a8
Author: Matthias.Ermeling <email address hidden>
Date: Mon Jul 20 13:24:59 2020 +1200

Bug 1841571: Allow internal search work with multibyte strings correctly

As some systems have trouble with strtolower() on multibyte string

Adding the same change for elasticsearch as well

Change-Id: I353e8045cac9beeae13f107728ee5fd378f4577c
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.