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

Can not find data record in database table course

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup

      1. Check out the following (resp):
        • master: git checkout 1d4fdb0d1c60448104bc9eac79b5123863c67cbd
        • 38: git checkout 255b3963288e743704dcc36da103f9db36e04116
        • 37: git checkout 08a62243c5e48721421f3bc67f7411609c7a5cd8
      2. Install site
      3. Login as admin
      4. Create 4 courses: "Course A", "Course B", "Course C" & "Course D"
      5. Create one student: "Charlie Carrot"
      6. Navigate to "Course A"
      7. Enrol "Charlie Carrot" as a student. And enrol also the admin user as student.
      8. Select "Course completion" from "Actions menu"
      9. Under "Condition: Completion of other courses" select "Course B" & "Course C" and press "Save changes"
      10. Navigate to "Courses > Manage courses and categories" in Site administration
      11. Delete "Course B"
      12. Navigate to "Course A"
      13. Turn editing on
      14. Add "Course completion status" block
      15. Access to the "More details" page
      16. Check the "Can't find data record in database table course." error is displayed

      Testing scenario 1: Update

      1. Update to the current git repository:
        • master: git checkout master
        • 38: git checkout MOODLE_38_STABLE
        • 37: git checkout MOODLE_37_STABLE
      2. Upgrade the site
      3. Navigate to "Course A"
      4. Access to the "More details" page from the "Course completion status" block
      5. Confirm you see "Course C" in the "Criteria" column (prior to this change you would get the reported exception at this point)
      6. Click on "View course report" in the "Course completion status" block.
      7. Confirm you see "Course C" in the completion table "Criteria" row

      Testing scenario 2: Delete a course

      1. Navigate to "Course A"
      2. Select "Course completion" from "Actions menu"
      3. Under "Condition: Completion of other courses" add also "Course D" to the selection ("Course C" should be selected) and press "Save changes"
      4. Navigate to "Courses > Manage courses and categories" in Site administration
      5. Delete "Course D"
      6. Navigate to "Course A"
      7. Access to the "More details" page from the "Course completion status" block
      8. Confirm you see "Course C" in the "Criteria" column (prior to this change you would get the reported exception at this point)
      9. Click on "View course report" in the "Course completion status" block.
      10. Confirm you see "Course C" in the completion table "Criteria" row

       

      Show
      Setup Check out the following (resp): master: git checkout 1d4fdb0d1c60448104bc9eac79b5123863c67cbd 38: git checkout 255b3963288e743704dcc36da103f9db36e04116 37: git checkout 08a62243c5e48721421f3bc67f7411609c7a5cd8 Install site Login as admin Create 4 courses: "Course A", "Course B", "Course C" & "Course D" Create one student: "Charlie Carrot" Navigate to "Course A" Enrol "Charlie Carrot" as a student. And enrol also the admin user as student. Select "Course completion" from "Actions menu" Under "Condition: Completion of other courses" select "Course B" & "Course C" and press "Save changes" Navigate to "Courses > Manage courses and categories" in Site administration Delete "Course B" Navigate to "Course A" Turn editing on Add "Course completion status" block Access to the "More details" page Check the "Can't find data record in database table course." error is displayed Testing scenario 1: Update Update to the current git repository: master: git checkout master 38: git checkout MOODLE_38_STABLE 37: git checkout MOODLE_37_STABLE Upgrade the site Navigate to "Course A" Access to the "More details" page from the "Course completion status" block Confirm you see "Course C" in the "Criteria" column (prior to this change you would get the reported exception at this point) Click on "View course report" in the "Course completion status" block. Confirm you see "Course C" in the completion table "Criteria" row Testing scenario 2: Delete a course Navigate to "Course A" Select "Course completion" from "Actions menu" Under "Condition: Completion of other courses" add also "Course D" to the selection ("Course C" should be selected) and press "Save changes" Navigate to "Courses > Manage courses and categories" in Site administration Delete "Course D" Navigate to "Course A" Access to the "More details" page from the "Course completion status" block Confirm you see "Course C" in the "Criteria" column (prior to this change you would get the reported exception at this point) Click on "View course report" in the "Course completion status" block. Confirm you see "Course C" in the completion table "Criteria" row  
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:

      Description

      Receiving the following dialogue when attempting to 'View course report' via the Course Completion Status block.

      Notice: Trying to get property of non-object in /home/xyz/public_html/completion/criteria/completion_criteria_course.php on line 138
      Can not find data record in database table course.

      More information about this error

      Debug info: SELECT id,category FROM

      {course}

      WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      Stack trace:
      line 1357 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6541 of /lib/accesslib.php: call to moodle_database->get_record()
      line 138 of /completion/criteria/completion_criteria_course.php: call to context_course::instance()
      line 417 of /report/completion/index.php: call to completion_criteria_course->get_title_detailed()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              chadsta Chad Outten
              Peer reviewer:
              Carlos Escobedo
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 45 minutes
                  5h 45m