I originally posted this in the developer area as I thought it was related to a plugin I created but it appears to be system-wide issue happening with all enrollment methods. I wanted to post this here since it isn't directly related to development of a add-on.
I'm running build 2.5+ (20130621) and every time I try to enroll in a course I get the following error. This happens with a manual enrollment or via paypal or custom gateway.
Error writing to database
Debug info: Column count doesn't match value count at row 1
INSERT INTO mdl_user_enrolments (enrolid,status,userid,timestart,timeend,modifierid,timecreated,timemodified) VALUES(?,?,?,?,?,?,?,?)
0 => '4',
1 => 0,
2 => '2',
3 => 1372132800,
4 => 0,
5 => '2',
6 => 1372211793,
7 => 1372211793,
Error code: dmlwriteexception
- line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
- line 1089 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 1131 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
- line 1294 of /lib/enrollib.php: call to mysqli_native_moodle_database->insert_record()
- line 125 of /enrol/manual/manage.php: call to enrol_plugin->enrol_user()
The site was upgraded from 2.4.x to 2.5 on a dev server when 2.5 was first released. I could have sworn this was working after the upgrade (but that was over a month ago and am a little foggy.) I upgraded to the latest 2.5 build tonight to see if that would help with no success.
Does anyone have any idea what would cause this?