Moodle
  1. Moodle
  2. MDL-28562

automatic naming of file in convert_image not working

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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:
    • Rank:
      18248

      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.

        Activity

        Show
        Jamie Pratt added a comment - https://github.com/jamiepratt/moodle/compare/master...MDL-28562_wip
        Hide
        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
        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
        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
        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
        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
        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
        Petr Škoda added a comment -

        ooops, sorry for the typo

        Show
        Petr Škoda added a comment - ooops, sorry for the typo
        Hide
        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
        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
        Rajesh Taneja added a comment -

        Nice Catch Jamie
        No problem found while updating picture.

        Show
        Rajesh Taneja added a comment - Nice Catch Jamie No problem found while updating picture.
        Hide
        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
        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: