mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
93 stars 159 forks source link

`date` element does not show correct dateitem if the date item does not exist #581

Closed matthewhilton closed 6 months ago

matthewhilton commented 1 year ago

E.g. if the date element is linked to {"dateitem":"gradeitem:1234",... but this does not exist in the context, it will just say 'Issued date' in the UI (because its the first item in the list), whereas if you query the database you can see the actual dateitem.

Would be good to alert the user somehow or throw an exception if this is the case.

You can end up in this situation if you made the element when it did exist, but then the grade item was deleted.

mdjnelson commented 7 months ago

Best solution here is to hide it imo, instead of warning users on the PDF.

mdjnelson commented 7 months ago

Sorry I can not replicate this. When I set them to show the date of the quiz I created it comes up fine on my PDF, then I deleted the quiz and run cron and refresh and the browser does not show these fields.

What version of Moodle and which version of the plugin are you running?