-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
3.3.3
-
None
-
2016081800
-
-
MOODLE_33_STABLE
DESCRIPTION
The progress bar is configured to monitor a questionnaire activity using the action "finished". This produces the error below. The error was encountered following an upgrade to the questionnaire plugin. The latest version of the plugin, 2017050101, contains some database schema changes. In particular mdl_questionnaire_responses.username is renamed to userid.
{noformat}
Error reading from database
Debug info: Unknown column 'username' in 'where clause'
SELECT id
FROM mdl_questionnaire_response
WHERE complete = 'y'
AND username = ?
AND survey_id = ? LIMIT 0, 1
[array (
0 => '4',
1 => '50',
)]
Error code: dmlreadexception
Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1143 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1894 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
line 1349 of /blocks/progress/lib.php: call to moodle_database->record_exists_sql()
line 262 of /blocks/progress/block_progress.php: call to block_progress_attempts()
line 288 of /blocks/moodleblock.class.php: call to block_progress->get_content()
line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 1203 of /lib/blocklib.php: call to block_base->get_content_for_output()
line 1255 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 579 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
line 39 of /theme/bootstrapbase/renderers/core_renderer.php: call to core_renderer->standard_head_html()
line 44 of /theme/clean/layout/columns3.php: call to theme_bootstrapbase_core_renderer->standard_head_html()
line 1164 of /lib/outputrenderers.php: call to include()
line 1092 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 261 of /course/view.php: call to core_renderer->header()
{noformat}
STEPS TO REPLICATE
1. Create a course.
2. Add a questionnaire activity to the course.
3. Add the progress bar block to the course.
4. Configure the progress bar block.
5. For the questionnaire activity set Monitored = Yes and Action = Finished.
6. Save changes.
OBSERVED BEHAVIOR:
Error reading from database
EXPECTED BEHAVIOR:
Changes saved successfully and course loads without error.
REPLICATION LOCATIONS
Replicated on Moodle 3.3.3 using version 201705101 of mod_questionnaire and version 2016081800 of block_progress.
USER IMPACT
Impacted courses are inaccessible without changes to progress bar configurations which can only be accessed via URL manipulation.