-
Improvement
-
Resolution: Fixed
-
Major
-
3.8.2, 3.10, 4.0, 4.1.1
-
MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_402_STABLE
-
MDL-68347-master-2 -
-
WP - Sprint 2.0 (Marina), WP Sprint 2023-I1.1 (Marina)
The "user_created" event is not triggered during course restore on purpose, restore process does not trigger any core events.
There is a "course_restored" event that can be observed, however there is no way/API currently to find the list of created users (or modules, etc)
From conversation with stronk7
Eloy Lafuente Plaza, [6 Apr 2020 at 10:53:53]:
so there are 2 alternatives:
- or we create that new user_created_on_reastore event
- or we use something into temp tables to have them at hand and we observe the course_restored event.
Marina, [6 Apr 2020 at 10:54:57]:
ok thanksit is ok to add methods to course_restored event class to find relevant data? Like list of created users for example
these methods can only be used inside event observers
Eloy Lafuente Plaza, [6 Apr 2020 at 10:56:23]:
doesn't sound wrong, is my first thought.can be useful to others observing the same event. Just hope it doesn't end being a spaghetti/monster event (then maybe we should consider moving it apart)
Marina, [6 Apr 2020 at 10:59:22]:
is it possible that there is a scenario when users are created during restore process but then another error occurs and course is not restored and course_restored event is not triggered?Eloy Lafuente Plaza, [6 Apr 2020 at 11:01:42]:
uff, everything is possible 🙂 I don't think we run restore under transaction ...
- will be (partly) resolved by
-
MDL-60988 Activity restore does not fire core\event\course_module_created event
-
- Open
-