por Claudio Visa.
Estimados
Buenos dias, tengo esto error al intentar matricular un usuario a un curso. El usuario esta dentro de la plataforma pero cuando quiero matricularlo me sale este error:
ERROR: syntax error at or near "THEN"
LINE 4: ...stname) = LOWER($13 OR LOWER(u.email) = LOWER($14 THEN 0 ELS...
^
SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.lastaccess FROM mdl_user u
LEFT JOIN mdl_user_enrolments ue ON (ue.userid = u.id AND ue.enrolid = $1)
WHERE u.id <> $2 AND u.deleted = 0 AND u.confirmed = 1 AND (email ILIKE $3 ESCAPE '\' OR u.firstnamephonetic ILIKE $4 ESCAPE '\' OR u.lastnamephonetic ILIKE $5 ESCAPE '\' OR u.middlename ILIKE $6 ESCAPE '\' OR u.alternatename ILIKE $7 ESCAPE '\' OR u.firstname ILIKE $8 ESCAPE '\' OR u.lastname ILIKE $9 ESCAPE '\' OR '' || u.firstname || ' ' || u.lastname ILIKE $10 ESCAPE '\')
AND ue.id IS NULL ORDER BY CASE WHEN '' || u.firstname || ' ' || u.lastname = $11 OR LOWER(u.firstname) = LOWER($12 OR LOWER(u.lastname) = LOWER($13 OR LOWER(u.email) = LOWER($14 THEN 0 ELSE 1 END, u.lastname, u.firstname, u.id LIMIT 30
[array (
0 => 372,
1 => '1',
2 => '%cvisa%',
3 => '%cvisa%',
4 => '%cvisa%',
5 => '%cvisa%',
6 => '%cvisa%',
7 => '%cvisa%',
8 => '%cvisa%',
9 => '%cvisa%',
10 => 'cvisa',
11 => 'cvisa',
12 => 'cvisa',
13 => 'cvisa',
)]
Error code: dmlreadexception
* line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 242 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
* line 776 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 432 of /enrol/locallib.php: call to pgsql_native_moodle_database->get_records_sql()
* line 462 of /enrol/locallib.php: call to course_enrolment_manager->execute_search_queries()
* line 453 of /enrol/externallib.php: call to course_enrolment_manager->get_potential_users()
* line 228 of /lib/externallib.php: call to core_enrol_external::get_potential_users()
* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()