Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7151

Unable to enter course when progress bar monitoring questionnaire activity with action of finished

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 3.3.3
    • Block: Progress
    • None
    • 2016081800
    • Hide

      1. Identify a course receiving "Error reading from database" when attempting to enter the course. Make note of the shortname of the course.
      2. Execute the following query inserting the shortname of the course in the indicated location.

      select c.id, bi.id as bui_editid from mdl_block_instances bi
      inner join mdl_context x on x.id = bi.parentcontextid
      inner join mdl_course c on c.id = x.instanceid
      where blockname = 'progress' and x.contextlevel = 50
      and c.shortname = '<enter course shortname>'

      3. Navigate to an accessible course which contains the progress bar block.
      4. Turn editing on.
      5. Click the gear icon in the Progress Bar block and select Configure Progress Bar block.
      6. Manipulate the URL using values from query results in step 2 to access the Progress Bar configurations in the course receiving the error. You will need to update two values in the URL, id and bui_editid. Update the URL and hit enter.
      7. Verify that the breadcrumbs reflect that you are now within the course receiving the error.
      8. Locate all questionnaire activities. For any which have action set to "finished" change the action to one of the other options.
      9. Save changes.

      Show
      1. Identify a course receiving "Error reading from database" when attempting to enter the course. Make note of the shortname of the course. 2. Execute the following query inserting the shortname of the course in the indicated location. select c.id, bi.id as bui_editid from mdl_block_instances bi inner join mdl_context x on x.id = bi.parentcontextid inner join mdl_course c on c.id = x.instanceid where blockname = 'progress' and x.contextlevel = 50 and c.shortname = '<enter course shortname>' 3. Navigate to an accessible course which contains the progress bar block. 4. Turn editing on. 5. Click the gear icon in the Progress Bar block and select Configure Progress Bar block. 6. Manipulate the URL using values from query results in step 2 to access the Progress Bar configurations in the course receiving the error. You will need to update two values in the URL, id and bui_editid. Update the URL and hit enter. 7. Verify that the breadcrumbs reflect that you are now within the course receiving the error. 8. Locate all questionnaire activities. For any which have action set to "finished" change the action to one of the other options. 9. Save changes.
    • 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.

            salvetore Michael de Raadt
            brian.winstead Brian Winstead
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.