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

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:

      Description

      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

       

        Attachments

        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

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              ralfh Ralf Hilgenstock
              Peer reviewer:
              Simey Lameze
              Integrator:
              Andrew Nicols
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/20

                  Time Tracking

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