Commit 8f26dfc2 authored by Ghada El-Zoghbi's avatar Ghada El-Zoghbi Committed by Robert Lyon
Browse files

Bug bug1836325: fix error with group search

If a group category is specified in the search,
it was failing due to incorrect order of values
passed to the SQL query.

Sponsored by The Australian National University

behatnotneeded

Change-Id: I53b822c16e9316d572b018c33f44deea53650845
(cherry picked from commit fa575209)
parent e1f6ac6f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2282,7 +2282,7 @@ function group_get_associated_groups($userid, $filter='all', $limit=20, $offset=
        $values = array_merge($values, array($query_string, $query_string, $query_string));
    }

    $count = count_records_sql('SELECT COUNT(*) FROM {group} g ' . $sql . ' WHERE g.deleted = ? ' . $ltiwhere . $query_where . $catsql, $values);
    $count = count_records_sql('SELECT COUNT(*) FROM {group} g ' . $sql . ' WHERE g.deleted = ? ' . $ltiwhere . $catsql . $query_where, $values);

    // almost the same as query used in find - common parts should probably be pulled out
    // gets the groups filtered by above
@@ -2299,7 +2299,7 @@ function group_get_associated_groups($userid, $filter='all', $limit=20, $offset=
            LEFT JOIN {group_member} gm ON (gm.group = g.id)' .
            $sql . '
            WHERE g.deleted = ? ' .
            $ltiwhere . $query_where . $catsql . '
            $ltiwhere  . $catsql . $query_where . '
            GROUP BY g.id, g.name, g.description, g.public, g.jointype, g.request, g.grouptype, g.submittableto,
                g.hidemembers, g.hidemembersfrommembers, g.groupparticipationreports, g.urlid, t.membershiptype, t.reason, t.role, g.editwindowstart, g.editwindowend
        ) g1