Course restore/import bug

Issue #46 resolved
Former user created an issue

Error reading from database
More information about this error
×
Debug info: ERROR: invalid input syntax for integer: "courseid"
SELECT COUNT(id) FROM mdl_course_sections WHERE course = $1
[array (
0 => 'courseid',
)]
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 1624 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
line 1697 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1678 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
line 1657 of /lib/dml/moodle_database.php: call to moodle_database->get_field_select()
line 88 of /course/format/tiles/backup/moodle2/backup_format_tiles_plugin.class.php: call to moodle_database->get_field()
line 46 of /course/format/tiles/backup/moodle2/backup_format_tiles_plugin.class.php: call to backup_format_tiles_plugin->fail_if_course_includes_excess_sections()
line 74 of /backup/moodle2/backup_plugin.class.php: call to backup_format_tiles_plugin->define_course_plugin_structure()
line 160 of /backup/util/plan/backup_structure_step.class.php: call to backup_plugin->define_plugin_structure()
line 413 of /backup/moodle2/backup_stepslib.php: call to backup_structure_step->add_plugin_structure()
line 88 of /backup/util/plan/backup_structure_step.class.php: call to backup_course_structure_step->define_structure()
line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute()
line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
line 145 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
line 410 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
line 136 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
line 136 of /backup/import.php: call to backup_ui->execute()

Is coming from what looks to be a typo in a recent commit 7 days ago here: https://bitbucket.org/dw8/moodle-format_tiles/commits/5f86c81055bbb7650fc1ee7fc0b872e27682fab2#Lbackup/moodle2/backup_format_tiles_plugin.class.phpT88

I’m assuming that
$countsections = $DB->get_field('course_sections', 'COUNT(id)', array('course' => 'courseid'));

should be:
$countsections = $DB->get_field('course_sections', 'COUNT(id)', array('course' => $courseid));

Comments (2)

  1. Log in to comment