-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.6
-
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.
- duplicates
-
MDL-63910 Timing of course_module events
-
- Reopened
-