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

About event \core\event\course_module_updated and save_form_elements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.6
    • Plagiarism
    • None
    • MOODLE_36_STABLE

      I am working on a plugin implementation, and I need to perform certain action after the assignment module setting is updated. The program logic is

      • after the user clicks the save button in the assignment edit page, the event course_module_updated event is triggered
      • in the event handler, the procedure will retrieve the updated setting configuration from the plugin created database and then do some action

      But after some testing, the setting retrieved in the 2nd step seems to be still the old settings, i.e. not the latest settings input from the user. And I found that the save_form_elements function, which suppose to save the settings, is called after the event_handler finished. As a result, the 2nd step will just work on the old setting which is not correct. As a workaround, I need to enter the assignment configuration page and click the save button again, such that the event handler can work on the "latest" setting saved from the "save_form_elements" function. 

       

      So I would like to ask if it is the correct behaviour or it is a bug, and any recommendation to implement the logic better, e.g. in the event_handler, I can also retrieve the latest config data instead of loading from the database.

            Unassigned Unassigned
            tplau Patrick Lau
            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.