-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.1
-
MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
When trying to download a course participants list as a csv file, for example, the system returns a MySQL error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' gcn.groupnames |
FROM mdl_user u
|
...' at line 1 |
SELECT u.firstname, u.lastname, , gcn.groupnames
|
FROM mdl_user u
|
...
|
-- line 153 of /user/action_redir.php: call to mysqli_native_moodle_database->get_recordset_sql() |
There are two commas after u.lastname.
The problem can be temporarily solved by removing that comma from /user/action_redir.php, line 144, since each element on the array $userfields->selects has a prepended comma:
$sql = "SELECT u.firstname, u.lastname, {$userfields->selects}
|
to
|
$sql = "SELECT u.firstname, u.lastname {$userfields->selects}
|
I guess this problem affects other functionalities.
In case it is relevant: this error appeared after upgrading to Moodle 4. Not a fresh installation.