Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68047

TCPDF lib change results in deleted .jpg images in plugins such as mod_certificate

XMLWordPrintable

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE
    • Hide

      Testing

      1. In a just created site, install mod_certificate:
        1. Go to the mod directory of your site and install mod_certificate:

          cd mod
          git clone https://github.com/mdjnelson/moodle-mod_certificate.git certificate
          

      2. Go to admin and upgrade will start, installing the certificate activity.
      3. Go to mod/certificate/upload_image.php
      4. In image type, select "Seal" and upload any JPG (it's important that the file has to be a .jpg !!) with name "moodle.jpg" (See attached moodle.jpg for example)
      5. Save changes.
      6. Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is there.
      7. In a course, enable editing mode and create a certificate activity:
        1. Set an activity name.
        2. Expand the "Design Options"
        3. In the "Seal or Logo Image" menu, select "moodle".
        4. Save and display
      8. Verify that you're in a page with text "Summary of previously received certificates".
      9. Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is still there.
      10. Click on "Get your certificate"
      11. Verify that you see a "Certificate to Achievement" to your current user.
      12. Verify that the certificate DOES show the JPG that you've uploaded on the bottom-right part of the certificate.

      Previous behaviour (not part of testing)

      1. Repeat steps 1-8 above, then
      2. Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is has disappeared.
      3. Click on "Get your certificate"
      4. Verify that you see a "Certificate to Achievement" to your current user.
      5. Verify that the certificate does NOT show the JPG that you've uploaded on the bottom-right part of the certificate.
      Show
      Testing In a just created site, install mod_certificate: Go to the mod directory of your site and install mod_certificate: cd mod git clone https://github.com/mdjnelson/moodle-mod_certificate.git certificate Go to admin and upgrade will start, installing the certificate activity. Go to mod/certificate/upload_image.php In image type, select "Seal" and upload any JPG (it's important that the file has to be a .jpg !!) with name "moodle.jpg" (See attached moodle.jpg for example) Save changes. Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is there. In a course, enable editing mode and create a certificate activity: Set an activity name. Expand the "Design Options" In the "Seal or Logo Image" menu, select "moodle". Save and display Verify that you're in a page with text "Summary of previously received certificates". Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is still there. Click on "Get your certificate" Verify that you see a "Certificate to Achievement" to your current user. Verify that the certificate DOES show the JPG that you've uploaded on the bottom-right part of the certificate. Previous behaviour (not part of testing) Repeat steps 1-8 above, then Verify that in the "moodledata" directory there is a "mod/certificate/pix/seals" directory and that the just uploaded file "moodle.jpg" is has disappeared. Click on "Get your certificate" Verify that you see a "Certificate to Achievement" to your current user. Verify that the certificate does NOT show the JPG that you've uploaded on the bottom-right part of the certificate.

      We found that latest changes in TCPDF lib delets uploaded files in mod_certificate . If settings  in a certificate are set or modified that includes logos or background images  they are deleted on the server. mod_certificate has no delete functionality. Finally my colleague  Benjamnin Wolf found the reason in tcpdf lib.

      We are now disabling the feature tin tcpdf lib that deletes the file

      There may be problems with other plugins also.

      See CONTRIB-7987

       

        1. MDL-68047.jpg
          MDL-68047.jpg
          35 kB
        2. moodle.jpg
          moodle.jpg
          0.4 kB
        3. rainbow.jpg
          rainbow.jpg
          0.4 kB

            stronk7 Eloy Lafuente (stronk7)
            ralfh Ralf Hilgenstock
            Simey Lameze Simey Lameze
            Andrew Lyons Andrew Lyons
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 30 minutes
                5h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.