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
89 stars 157 forks source link

Background images can be overriden when using different templates and more than 1 page per certificate. #576

Closed darevalo1 closed 4 months ago

darevalo1 commented 11 months ago

Hi MDJNELSON ! and customcert team

We found and replicated this error on background images override automatically any background image if a certificate uses more than 1 page or if there are more than one custom certificate template with a backgrpund image element.

STEPS TO REPLICATE Go to any custom certificate activity or go to any custom certificate template or create a new one on any course. First Make sure you are using 1 page on the custom certificate. Add a background element. Click on setting element buttom action. Select the background you want. save changes on the certificate. Then add a new page in the same certificate activity on option "add page". On this new second page, click on add background element. Click on setting element butom action Select or upload a different background image than the 1st page. save changes. go a check the background element on the page 1 Watch the background element in the page 1 is now override by the background image element of the page 2. This same situation happens with diferent templates, if we have already two diferent templates, if we upload a background image to the first template, the second template background will be override or makes the backgrpund gets blank until go to the background setting and upload the image, but this will be conflicting overiding the first template as well making unhandle this.

OBSERVED BEHAVIOR: If we use more than 1 page per certificate activity, the background image will override or replace the background image on the others pages.

This same situation happens with diferent templates, if we have already two diferent templates, if we upload a background image to the first template, the second template background will be override or makes the backgrpund gets blank until go to the background setting and upload the image, but this will be conflicting overiding the first template as well making unhandle this.

EXPECTED BEHAVIOR: Each page should display a different background image that we set without overriding any other background image page or template.

It seems in 4.1 The drop down menu is lost or hide to choose the backgrpound elements we have uploaded on this course. In prevoous versions like 3.10, the dropdown menu shows the elements we have uploaded, leting us choose easier the elements.

As Troubleshooting, we suggested them to create different custom cert activity for each page temporary to avoid this page problem.

Thanks mdjnelson for your time, we hope you can check this soon. Regards

SCREENSHOTS ATTACHED:

page 1 and 2 on 4 1 view from background element, there is no dropdownmenu and can see the image file already replaced by the scond page view from ceprev with the well displayed options and not replacing elements
darevalo1 commented 11 months ago

Hi @mdjnelson We found some bugs on the background images settings on custom certificate when using templates and more than one pages with background images in moodle 4.1. We hope you can check this issue when you can. Thanks in advance Mark

licethrey91 commented 7 months ago

Hi @mdjnelson, I would appreciate it if you could provide an update.

mdjnelson commented 6 months ago

I have added this to the list of things I will be working on in the near future.

Please note: It is just me maintaining this project so it can take time.

mdjnelson commented 5 months ago

I did this.

  1. Created a custom certificate.
  2. On the first page added a BG element with image X.
  3. I then added the second page and added a BG element with image Y.
  4. When I clicked "Save changes and preview" it works as expected.

What am I missing?

licethrey91 commented 5 months ago

Hi @mdjnelson, Thanks for your answer. I tested on sites with versions 4.1.5+ and 4.1.6, the behavior is the same, as shown in the attached video.

Steps:

  1. Created a custom certificate.
  2. Added a BG element with image1 on the first page.
  3. Added the second page and added a BG element with image2.
  4. Then I click on the "save changes and preview" button.

Video.mov.zip

Thank you!

mdjnelson commented 5 months ago

Ah I think the issue I made was to upload all the images I wanted when I added it on the first page before I created the second one.

licethrey91 commented 5 months ago

Hi Mark, Could you replicate it?

mdjnelson commented 5 months ago

I uploaded all the images I needed when I added my first BG element to the first page, then on the second page just added a BG element and then in the drop down selected the one I wanted. I havent tried the way in your demo but im pretty sure I know what is going on.

licethrey91 commented 5 months ago

Hi Mark, Thanks for testing, I would like to know if you have any updates on this?

Thank you!

mdjnelson commented 4 months ago

Is the temporary solution to upload both BG images first before adding them not working? This is not my top priority right now as I have server performance issues to address.

darevalo1 commented 4 months ago

It is not a temproary solution, it was a replication process to watch the behavior of this error. Thanks in advance @mdjnelson

mdjnelson commented 4 months ago

I was talking about what I mentioned above as a temporary solution. Have you tried that?

darevalo1 commented 4 months ago

Hi @mdjnelson Oh I´m sorry, we did the test but got the same result. The image will be replaced and override the images background on each page. this still hapenning in moodle 4.1 For temporary solution, we create each page in different custom certificate activities. Additionally, for templates we recommend to create the certificates in a course level context to do not compromise the templates images overrides in a general site context.

mdjnelson commented 4 months ago

Hello, sorry for the delay in getting to this.

I had a look at the video and can see there are some customisations on your Moodle site that is causing this. I am not sure if it is a setting somewhere or there has been custom changes to the code.

By default this is what selecting an image is like -

Screen Shot 2024-03-13 at 12 18 05 pm

Notice here that there is a drop down to select the image. In your case there is no drop down. In Moodle when an image is dragged into the file manager it goes into a "draft" file area. You have to click 'Save changes' for it to be uploaded to the actual course area. So, what you have to do is upload the image by dragging it into the file manager, saving, then reediting the background image element again and selecting the image from the drop-down - if you try and do this in one go it doesn't work as the drop-down box has not been updated. To avoid the tedious issue of uploading then re-editing it it seems your site got rid of the drop-down and just uses whatever image was last uploaded.

On my install when I go to add a background image to the second page the image below is what is shown, as you can see the image that was added on the first background image element is also shown.

Screen Shot 2024-03-13 at 12 22 59 pm

Do you have a dedicated developer and are you able to find out what changes were made to your Moodle install?

darevalo1 commented 4 months ago

Hi @mdjnelson thanks for the information: We would like to know the version of Moodle you did this last test?

Thank in advance, regards

mdjnelson commented 4 months ago

Hi @darevalo1 I tested this on the latest version of Moodle 4.1 (and 4.1 for the plugin). As an ex Moodle HQ employee I can say since i've known this software that is always how it behaved.

darevalo1 commented 4 months ago

Hi Mdjnelson thanks for the update: It seems this error is happening for us in Moodles 4.1, but tried on moodle 4.3 and it worked. We will be doing some new test with the newr versions and version plugins to make sure what could be happening. We will let you know.

mdjnelson commented 4 months ago

Thanks for the response. I am closing this as I could not replicate it.