Closed leonstr closed 1 year ago
Feel free to create a MR and I will review it. :)
Merged. Thanks.
Thanks Mark. Apologies for the work needed on top of the PR.
That's OK @leonstr. I got ahead of myself thinking it would be quick to add a bunch more of events and unit tests but no, not a small task at all. 😄
If you could however look at the changes (https://github.com/mdjnelson/moodle-mod_customcert/commits/MOODLE_400_STABLE) I made and give me a +1 here that would be great since no one reviewed them. 😄
Hi @mdjnelson there are four issues I can see:
template_created
and a template_updated
event. The latter is a result of add_page()
triggering both a page_created
and a template_updated
. Having both template_created
and template_updated
on creating a template doesn't make sense to me as 'create' is one action.template_updated
events. The second one is a result of save_page()
triggering both a page_updated
and a template_updated
. Again, two events -- this time the same event -- for one action feels like a bug.page_updated
is triggered for each page even though only one has been changed.element_*
and page_*
events I think get_description()
should use 'the', not 'a'/'an', e.g. The user with id '...' updated the page with id '...', not The user with id '...' updated a page with id '...'. Trivial but the later reads wrong to me, and it seems to be what Moodle uses, e.g. for course events.I'll try to find time to see if I can patch these in which case I'll open an issue with a PR for you to review. For 1. and 2. it's not a case of simply removing the template_created
and template_updated
from add_page()
and save_page()
, otherwise there'd be no template_updated
when you click + Add page.
Thanks a lot @leonstr, it would be much appreciated if you could create a MR for this.
@leonstr I have created https://github.com/mdjnelson/moodle-mod_customcert/issues/564.
If someone edits a certificate layout or edits an element I think there should be an event triggered resulting in an entry in the Moodle logs.
For example: Time: 17 Oct 2022 15:24, Component: Custom certificate, Description: The user with id '2' edited the certificate of 'customcert' activity with course module id '485'.