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

automatic naming of file in convert_image not working

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.5, 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Files API
    • Labels:

      Description

      Get an error :

      Unknown exception related to local files (Unsupported mime type)

      When calling convert_image without a new filename. The code should automatically name the new file with the same name as the old file but there is a typo.

        Gliffy Diagrams

          Attachments

            Activity

            Show
            jamiesensei Jamie Pratt added a comment - https://github.com/jamiepratt/moodle/compare/master...MDL-28562_wip
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for reporting this and providing a solution.

            Could you please provide replication instructions and possibly screenshots. That would help us test a solution.

            Show
            salvetore Michael de Raadt added a comment - Thanks for reporting this and providing a solution. Could you please provide replication instructions and possibly screenshots. That would help us test a solution.
            Hide
            jamiesensei Jamie Pratt added a comment -

            Hi Michael,

            Please take a look at the patch. There is a VERY obvious typo in the code. There is no way to duplicate this error without quite some effort writing some test code. It doesn't seem worth it for a one character change. This does affect other third party code for whom this part of the Moodle API will not work as expected.

            Thanks,

            Jamie

            Show
            jamiesensei Jamie Pratt added a comment - Hi Michael, Please take a look at the patch. There is a VERY obvious typo in the code. There is no way to duplicate this error without quite some effort writing some test code. It doesn't seem worth it for a one character change. This does affect other third party code for whom this part of the Moodle API will not work as expected. Thanks, Jamie
            Hide
            timhunt Tim Hunt added a comment -

            Petr, I think this is obviously a good fix, so +1 from me, but this is more your area of code, so hopefully you can have a quick look and confirm the change is right.

            Integrators, please cherry-pick onto the 2.1 stable branch, and the 2.0 stable branch if the patch applied cleanly.

            Show
            timhunt Tim Hunt added a comment - Petr, I think this is obviously a good fix, so +1 from me, but this is more your area of code, so hopefully you can have a quick look and confirm the change is right. Integrators, please cherry-pick onto the 2.1 stable branch, and the 2.0 stable branch if the patch applied cleanly.
            Hide
            skodak Petr Skoda added a comment -

            ooops, sorry for the typo

            Show
            skodak Petr Skoda added a comment - ooops, sorry for the typo
            Hide
            nebgor Aparup Banerjee added a comment -

            nice catch, this has been integrated into 2.x stables and master. I'll leave this for testing if someone can think of a test for this but otherwise i think its ok to pass this.

            Show
            nebgor Aparup Banerjee added a comment - nice catch, this has been integrated into 2.x stables and master. I'll leave this for testing if someone can think of a test for this but otherwise i think its ok to pass this.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Nice Catch Jamie
            No problem found while updating picture.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Nice Catch Jamie No problem found while updating picture.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            And this has landed upstream, just on time for the upcoming new releases week. Thanks for it!

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - And this has landed upstream, just on time for the upcoming new releases week. Thanks for it! Ciao

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Nov/11