ronefel / moodle-mod_googlemeet

Google Meet resource module plugin for Moodle 3.7+
Other
19 stars 15 forks source link

dmlreadexception in PostgreSQL #2

Closed ewallah closed 3 years ago

ewallah commented 3 years ago

After creating a new instance, I get a database error: relation does not exist. Only a (working) button for entering the room is created, then the debugging shows this output:

More information about this error

×Debug info: ERROR: relation "mdl_googlemeet_events" does not exist
LINE 2: FROM mdl_googlemeet_events
^
SELECT id,eventdate,duration
FROM mdl_googlemeet_events
WHERE googlemeetid = 1
AND (eventdate > 16070288838828 OR eventdate = 160798272910)
LIMIT 5
[array (
)]
Error code: dmlreadexception
×Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 329 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 920 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 465 of /mod/googlemeet/locallib.php: call to pgsql_native_moodle_database->get_records_sql()
line 82 of /mod/googlemeet/view.php: call to googlemeet_get_upcoming_events()
ronefel commented 3 years ago

Hi @ewallah

Did you have version 0.1.0 and updated to 1.0.0?

If so, please uninstall the plugin and directly install version 1.0.0.

mudrd8mz commented 3 years ago

I just ran into this as well. This is because there is hard-coded "mdl_" prefix in the SQL query in googlemeet_get_upcoming_events() that reads

 FROM mdl_googlemeet_events

It must be

FROM {googlemeet_events}
mudrd8mz commented 3 years ago

Reference: https://docs.moodle.org/dev/Data_manipulation_API#Table_prefix

ewallah commented 3 years ago

Indeed, David, the error disappears when the hard-coded prefix is removded.

No, Rone, this was a new installation (version 1.0.0).

ronefel commented 3 years ago

Thanks @mudrd8mz and @ewallah

I really was not paying attention it. It is now corrected.