ERROR: el operador no existe: character varying = integer LINE 1: ...grades WHERE STUDENT_ID = 2 AND MARKING_PERIOD_ID = 27 ORDER... ^ HINT: Ningún operador coincide con el nombre y el tipo de los argumentos. Puede ser necesario agregar conversiones explícitas de tipos.Et en anglais:
ERROR: operator does not exist: character varying = integer LINE 1: ...grades WHERE STUDENT_ID = 1 AND MARKING_PERIOD_ID = 45 ORDER... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Voici comment la résoudre:
Fichier: /Modules/Grades/EditReportCardGrades.php
Requête incriminée:
SELECT * FROM student_report_card_grades WHERE STUDENT_ID = 2 AND MARKING_PERIOD_ID = 27 ORDER BY IDExplication: MARKING_PERIOD_ID est un champ character varying mais PHP lui donne un integer, donc PostgreSQL n'aime pas et nous renvoie une erreur. Il faut en effet faire un transtypage (cast) explicite.
Voici le fix, ligne 189 du fichier, remplacer par:
//modif: SQL error fix: operator does not exist: character varying = integer, add explicit type casts //$sql = 'SELECT * FROM student_report_card_grades WHERE STUDENT_ID = '.$student_id.' AND MARKING_PERIOD_ID = '.$mp_id.' ORDER BY ID'; $sql = 'SELECT * FROM student_report_card_grades WHERE STUDENT_ID = '.$student_id.' AND cast(MARKING_PERIOD_ID as integer) = '.$mp_id.' ORDER BY ID';