Since now everything was all pretty outdated, I finally made the brave move to install a completely new instance:
- Moodle 3.8+ (Build: 20191220)
- PHP 7.3
- MariaDB 10.3.15
Since I have easy access to the www directory hosting the code, Old Certificate plugin is still providing a more effective solution for me.
However, living in Europe, I also need GDPR compliance so I ended up installing the latest version available on GitHub, that includes GDPR management:
git clone git://github.com/mdjnelson/moodle-mod_certificate.git certificate
However, as soon as I restored a Course, the Certificate Activity was not working as expected and I ended up with PDF certificates lacking the background image.
I cancelled the activitiy and recreated it from scratch in Moodle 3.8 and it was the same.
I uninstalled the github version and installed the .zip downloaded from Moodle website (mod_certificate_moodle33_2016052300.zip) but it was the same.
By re-pasting the image in the directory after every step, I found the very moment the image is deleted: when the
is called (when you click the certificate link in your course page to open the certificate activity).
When you the press the "Get Certificate" button to get the PDF, the image has been already deleted by the /pix/borders folder
I changed the Certificate type, the folder (watermarks instead of borders), I deactivated the "Save certificates" and changed the Delivery, but nothing changed.
I tried to have a look at the code of view.php, but I have no knowledge in PHP and I was not able to spot anything.
Note: I have installed Custom Certification Plugin too. It's great but it is still lacking some features I need (e.g. define a "printhours" and "customtext" fields changing at every course, graphical primitives such as setDrawColor, setRenderingMode)