Media Cloud vs LearnDash certificates conflict



  • Media Cloud has been having issues playing along with the popular Leardash plugin, this time it breaks the background (featured) image for the certificates (https://www.learndash.com/support/docs/core/certificates/create-certificate/)

    This was tested with every plugin turned off (but Learndash and MediaCloud), every test we just got a blank page, the only solution was turning off image support in Media Cloud and then re uploading the certificates

    https://i.imgur.com/bJ4AajP.png

    The previous solution was ignoring PNG MIME Types, but now thats not enough
    😞



  • @Jorge-Ocampo-Alcázar

    Can you explain this as though you are talking to someone who has never used LearnDash before.

    What are the exact steps to replicate?



  • Of course; there are 2 issues, the fonts and the featured image
    But first: LearnDash certificate is a custom post:

    alt text

    In the content area you can include dynamic fields that are generated for each individual user who is awarded a certificate. For example:

    User’s Name
    Course Title
    etc

    alt text

    The featured image is the "background" of your certificate, it must be a JPG
    When the user pass the Course, he is awarded a certificate, on click on the "certificate button" learn dash opens a new window with a PDF, like this:

    alt text

    In this image the User Name is a dynamic field, everything else is a JPG as background
    The user can download or print this PDF and that's all



  • Now, the issues

    1. When Media Cloud is installed, this Font conflict appears when you click on the "view my certificate": "TCPDF ERROR Could not include font definition file: helvetica"

    alt text

    The solution for this issue is to copy the content of the FONTS folder from

    plugins/sfwd-lms/includes/lib/tcpdf/fonts
    to
    plugins/ilab-media-tools-premium/vendor/tecnickcom/tcpdf/fonts

    So, is not a complex solution, but it must be done after every update on every site. I tried adding this code to functions.php, but does not solve the issue

    define('K_PATH_FONTS', WP_PLUGIN_DIR.'/sfwd-lms/includes/vendor/tcpdf/fonts/');



    1. The second issue is more complex. In previous versions, LearnDash allowed us to use PNG images as featured image (background) for the certificates, but not anymore, the image must be a JPG

    So, when MediaCloud is active, this JPG is sent to the cloud, and LearnDash is no able to retrieve it, the certificate shows the dynamic fields, but no background.
    So the only option at this moment is turning off image support in Media Cloud settings and re-uploading our featured images

    alt text

    I'm reaching also to LearnDash support, but finding a way to exclude some images from the Cloud could solve this issue
    I hope this explains the issues a bit better



  • @Jorge-Ocampo-Alcázar

    As for the fonts, that should be solved in the premium version as we use this code:

    class LearnDashIntegration {
    	public function __construct() {
    		if (!defined('K_PATH_FONTS')) {
    			define('K_PATH_FONTS', WP_PLUGIN_DIR.'/sfwd-lms/includes/vendor/tcpdf/fonts/');
    		}
    	}
    }
    

    But I see LearnDash has changed the folder, so I will update tomorrow and test.

    The other bit will require more work and I likely can't get to it until next week. But maybe there is something I can do when I update the font issue tomorrow.

    Thanks for the details steps btw!



  • Thank you Jong!



  • @Jorge-Ocampo-Alcázar

    I'm pushing an update that fixes the font thing, but I definitely can't replicate your issue with the jpeg background.

    Maybe you can tell me if I'm doing something wrong:

    https://www.loom.com/share/f8c274c72ba44945b57d7f71f069fa0b

    I am using LearnDash 3.0.7, is there a newer version? Yes, 3.1.1.

    I will see if I can find it wink and let you know if it changes anything on my end.



  • @Jorge-Ocampo-Alcázar

    So even with 3.1.1 I'm still able to see the jpeg in the certificate.



  • @Jorge-Ocampo-Alcázar

    I'm pushing the update now. LMK if it randomly fixed stuff for you.

    If not, hit me on the popup chat in the plugin or on https://kb.mediacloud.press and we can schedule a screen share to figure out what the heck is going on.


Log in to reply