FMCorz / moodle-block_xp

A gamification plugin for Moodle allowing students to gain experience points and level up.
https://levelup.plus/?ref=github
149 stars 41 forks source link

Database error when resetting course data on MySQL #28

Closed FMCorz closed 8 years ago

FMCorz commented 8 years ago

I use it on Moodle 2.7. I have an error, but I'm not sure that a Level Up "bug". On the "Report" target there is a "Reset course data" button. When I clic on this button and on the following page I clic on "Continue" I obtain an error message : "Error writing to database" (see also the debug mode message below).

Any suggestion ? Jacques.

The debug mod message: Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b WHERE b.courseid = '1'' at line 1 DELETE FROM mdl_block_xp b WHERE b.courseid = ? [array ( 0 => 1, )] Error code: dmlwriteexception Stack trace:

line 446 of \lib\dml\moodle_database.php: dml_write_exception thrown line 974 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end() line 639 of \blocks\xp\classes\manager.php: call to mysqli_native_moodle_database->execute() line 63 of \blocks\xp\report.php: call to block_xp_manager->reset_data()

FMCorz commented 8 years ago

I have just fixed this now. Sorry for the trouble. I will make this available in the next release as soon as possible. Don't forget to star the project and add it to your favourites on Moodle.org :). Cheers!