Closed leonstr closed 4 months ago
As a first go at fixing these I've added branch 564-401 commit 1941274.
Another issue: I don't like that every _pageupdated also has a _templateupdated, if there's one action then two events seems wrong. Having one _templateupdated + one or more _pageupdated would make sense. I'd need to do a bit more testing to see if the _templateupdated could be removed from template->save_page(), i.e. does a _templatecreated or _templateupdated definitely get triggered every time save_page() is called? I haven't tried to fix this.
Another issue: There are two _templatecreated events when copying a template. Possibly template->copy_to_template() doesn't need the:
\mod_customcert\event\template_created::create_from_template($copytotemplate)->trigger();
because manage_templates.php calls:
$newtemplate = \mod_customcert\template::create($name, $template->get_contextid());
which calls:
\mod_customcert\event\template_created::create_from_template($template)->trigger();
?
There's a further issue that rearranging elements by drag and drop then saving these this doesn't trigger any events. At this stage I think this specific issue should be added to it's own ticket, patching the above issues has taken long enough and retro-fitting events to rearrange.php
will take a bit of thought.
Edit: Added this as #599 .
@leonstr i've lost track. Can you help me out and let me know if this can be closed?
Yes, as far as I know the issues were addressed in 62b2c2f and this can be closed.
I've tested the fixes for #564 and see the following issues:
Tested with 7ee063e (MOODLE_401_STABLE) on Moodle 4.1.3+ (build: 20230526).