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

The \core\event\course_restored event is triggered on any restore, not just courses.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.3, 2.7, 2.8
    • Fix Version/s: 2.6.4, 2.7.1
    • Component/s: Events API
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Run the unit tests in course/tests/courselib_test.php.
      Test 2 (For 2.7 and master only!)

      The logging API which lists events in the log report was only introduced in 2.7. There was no original add_to_log call in the place of this event being fired, instead we were replacing an existing event which is not shown anywhere in Moodle. This is why these steps can not be applied to 2.6.

      1. Create a course.
      2. Open one tab on report/log/index.php and view the 'Site logs'.
      3. Create an activity.
      4. Duplicate this activity.
      5. View the report tab and ensure there is no 'Course restored' log.
      6. Backup and restore the course.
      7. View the report and ensure there is a 'Course restored' log entry under the restored course
      8. Restore course into the existing course
      9. View the report and ensure there is a 'Course restored' log entry under this course
      Show
      Test 1 Run the unit tests in course/tests/courselib_test.php. Test 2 (For 2.7 and master only!) The logging API which lists events in the log report was only introduced in 2.7. There was no original add_to_log call in the place of this event being fired, instead we were replacing an existing event which is not shown anywhere in Moodle. This is why these steps can not be applied to 2.6. Create a course. Open one tab on report/log/index.php and view the 'Site logs'. Create an activity. Duplicate this activity. View the report tab and ensure there is no 'Course restored' log. Backup and restore the course. View the report and ensure there is a 'Course restored' log entry under the restored course Restore course into the existing course View the report and ensure there is a 'Course restored' log entry under this course
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-45721_master
    • Story Points:
      5
    • Sprint:
      BACKEND Sprint 13

      Description

      1. Visit a course.
      2. Duplicate an activity.
      3. Notice there is a 'course restored' event.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jul/14