Group search fails when Group Category is specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Ghada El-Zoghbi | ||
19.04 |
Fix Released
|
High
|
Unassigned | ||
19.10 |
Fix Released
|
High
|
Ghada El-Zoghbi |
Bug Description
Mahara: 19.04.0
Linux: 16.04
DB: Postgres
Browser: FF
If a group search is conducted when a group with a '.' in the name and a category is specified, the following error occurs:
WAR] 3c (lib/errors.
INNER JOIN (
) t ON t.id = g.id WHERE g.deleted = ?
AND (
OR g.description ILIKE '%' || ? || '%'
OR g.shortname ILIKE '%' || ? || '%'
) AND g.category = ?")Command was: SELECT COUNT(*) FROM "group" g
INNER JOIN (
) t ON t.id = g.id WHERE g.deleted = ?
AND (
OR g.description ILIKE '%' || ? || '%'
OR g.shortname ILIKE '%' || ? || '%'
) AND g.category = ? and values was (0:2,1:
Call stack (most recent first):
log_
log_
SQLExceptio
get_
count_
group_
The issue is not due to the '.' in the group name but rather because the SQL is incorrectly applying the values. i.e. $catsql and $query_where are concatenated in the wrong order in group_get_
Changed in mahara: | |
assignee: | nobody → Ghada El-Zoghbi (ghada-z) |
Changed in mahara: | |
milestone: | none → 19.10.0 |
status: | New → Fix Committed |
importance: | Undecided → High |
To reproduce:
1. Ensure group categories are enabled (and enter a few categories: Category 1, Category 2, etc)
2. Create a group with name "19.04 test group"
3. Search on the group:
- search = 19.04
- category = Category 1
4. Click Search
What happens now:
You will be presented with the above error
What should happen:
The page should display a list of matching groups (or none)