Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69563

Database error when grading users in forum accessed via activities block

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.1
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      Steps to replicate:

      1. Access a test course and add the 'Activities' block
      2. Create a new forum activity in any topic section (not the general section)
        1. Enter a title
        2. Set Forum type to 'A simple single discussion'
        3. Set 'Whole forum grading' to Type>Point
        4. Save and return to course
      3. Click 'Forums' in the Activities block
      4. Click the link to the forum to be taken to the forum page
      5. Click 'Grade users'

      Expected result:

      User grading screen appears

      Observed result:

      No grading screen appears. The following error appears:

       

      invalidrecordunknown

      Can't find data record in database.
      File: /lib/dml/moodle_database.php
      Line: 1627
      Stack trace: SELECT c.* FROM {course_modules} cm JOIN {course} c ON c.id = cm.course WHERE cm.id = ? [array ( 0 => 0, )] Error code: invalidrecordunknown * line 1627 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown * line 2237 of /lib/modinfolib.php: call to moodle_database->get_record_sql() * line 4089 of /course/externallib.php: call to get_course_and_cm_from_cmid() * line ? of unknownfile: call to core_course_external::get_enrolled_users_by_cmid() * line 261 of /lib/externallib.php: call to call_user_func_array() * line 81 of /lib/ajax/service.php: call to external_api::call_external_function()
       
      Other notes:
      **I noticed that this only occurs when accessing the forum link via the Activities block, which gives a link that looks like _https://sandbox.moodledemo.net/mod/forum/view.php?f=3_
       
      However, when accessing via the course page, it doesn't occur and instead the link looks like: https://sandbox.moodledemo.net/mod/forum/view.php?id=4
       
      Tested and can replicate on https://sandbox.moodledemo.net

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            prankin Phillip Rankin
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: