I'm using version 1.7 and I have got a strange error below for the specific course only. The rest of the courses were fine.
Warning: Invalid argument supplied for foreach() in /documentroot/blocks/studentstracker/locallib.php on line 237
Warning: count(): Parameter must be an array or an object that implements Countable in /documentroot/blocks/studentstracker/locallib.php on line 241
Error
ERROR: Incorrect number of query parameters. Expected 3, got 2.
Debug info:
Error code: invalidqueryparam
Stack trace:
line 945 of /lib/dml/moodle_database.php: dml_exception thrown
line 1268 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
line 1671 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
line 1744 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1954 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
line 243 of /blocks/studentstracker/locallib.php: call to moodle_database->count_records_sql()
line 168 of /blocks/studentstracker/locallib.php: call to studentstracker::has_role()
line 120 of /blocks/studentstracker/block_studentstracker.php: call to studentstracker->get_enrolled_users()
line 341 of /blocks/moodleblock.class.php: call to block_studentstracker->get_content()
line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 1181 of /lib/blocklib.php: call to block_base->get_content_for_output()
line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
line 3950 of /lib/outputrenderers.php: call to block_manager->region_has_content()
line 40 of /theme/boost/layout/columns2.php: call to core_renderer->blocks()
line 1374 of /lib/outputrenderers.php: call to include()
line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 253 of /course/view.php: call to core_renderer->header()
$roles = join(',', array_fill(0, count($roleids), '?'));
print_object("roles = " . print_r($roles, true));
$r = $DB->count_records_sql("SELECT COUNT(id) FROM {role_assignments} WHERE roleid IN($roles) AND contextid=? AND userid=?",
$params);
Any advise is deeply appreciated.