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

Overwriting Background Image Doesn't Work #623

Closed spreissolms closed 4 months ago

spreissolms commented 4 months ago

This assumes the used template already has a background image.

When you create a custom certificate module thereafter, and add a new background image, saving it for preview, shows the former background image and not the one you put in place of it.

Steps to Replicate:

  1. Go to mod/customcert/manage_templates.php
  2. Create a template, and upload a background image
  3. Save the template, then go to a course and create a custom certificate module
  4. In the certificate settings, load the template
  5. Swap the background image for another
  6. Save changes and preview the certificate

Observed: The former background image still shows Expected: The swapped background image should be appearing.

Plugin version tested: 4.1.1 (2022112801)

mdjnelson commented 4 months ago

You have to go back and re-edit the element and select it from the drop down. This is because Moodle doesn't save the file until the form is submitted. #613 addresses this so you can save and then be taken back to the page to the drop-down and choose again.

phil-r-openlms commented 3 months ago

@mdjnelson This is occurring with the 'Background image' element, rather than the 'Image' element, so there is no dropdown to select the image file. Only the file picker box appears.

If you have no site-level certificate templates, the background image will change properly when replaced in the activity instance. If you have at least one site-level certificate (even if it has not been loaded for the activity instance) then its background image will always stick, no matter how many times you try replacing the image in the activity instance using the file picker.