Moodle
  1. Moodle
  2. MDL-36986

Add a course_restored event trigger

    Details

    • Rank:
      46522

      Description

      It would be handy to be able to run other processes after a course has been restored.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for putting that up. Hopefully we'll catch up on peer reviewing now that 2.4 is released.

          Show
          Michael de Raadt added a comment - Thanks for putting that up. Hopefully we'll catch up on peer reviewing now that 2.4 is released.
          Hide
          Petr Škoda added a comment - - edited

          +1, please submit for integration

          Show
          Petr Škoda added a comment - - edited +1, please submit for integration
          Hide
          Mark Nielsen added a comment -

          Hey Petr, I cannot move tickets past peer review. Perhaps you or someone else could?

          Show
          Mark Nielsen added a comment - Hey Petr, I cannot move tickets past peer review. Perhaps you or someone else could?
          Hide
          Petr Škoda added a comment -

          submitted for integration, thanks

          Show
          Petr Škoda added a comment - submitted for integration, thanks
          Hide
          Dan Poltawski added a comment -

          Integrated to master. Thanks a lot Mark!

          Show
          Dan Poltawski added a comment - Integrated to master. Thanks a lot Mark!
          Hide
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for master only.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working as expected. Tested for master only. Test passed.
          Hide
          Damyon Wiese added a comment -

          Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone!

          Regards, Damyon

          Show
          Damyon Wiese added a comment - Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone! Regards, Damyon
          Hide
          Rex Lorenzo added a comment - - edited

          Just a note, I incorporated this patch, but found that when duplicating course modules triggers the "course_restored" event. Is that intended?

          If so, how do I detect if the "course_restored" is an actual restore vs a duplicate in my event handlers? I looked at the event data being returned and it doesn't seem to indicate this.

          Show
          Rex Lorenzo added a comment - - edited Just a note, I incorporated this patch, but found that when duplicating course modules triggers the "course_restored" event. Is that intended? If so, how do I detect if the "course_restored" is an actual restore vs a duplicate in my event handlers? I looked at the event data being returned and it doesn't seem to indicate this.
          Hide
          Mark Nielsen added a comment -

          Hey Rex, the event handler does get the various settings of the backup, like the target. Checkout the backup class for the constants. Depending on what you want to capture, you may only want backup::TARGET_NEW_COURSE. Hope that helps!

          Show
          Mark Nielsen added a comment - Hey Rex, the event handler does get the various settings of the backup, like the target. Checkout the backup class for the constants. Depending on what you want to capture, you may only want backup::TARGET_NEW_COURSE. Hope that helps!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: