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

Trying to export a preset as a .zip file results in errors

    Details

    • Testing Instructions:
      Hide

      1) Add a database module
      2) Create some fields and add one or two records.
      3) Click on the Templates tab and click Save Template at the bottom of the page. (No need to alter the template)
      4) Click on the Presets tab. Click Export under the 'Export as zip' section.
      [Test] Check to see if a dialogue box pops up asking you to save the file.
      5) Save the file.
      6) Create a new database activity.
      7) Click on the Presets tab. in the 'Import from zip file' section choose the downloaded file and then import.
      [Test] Make sure that the fields are still the same as the previous database module.

      Show
      1) Add a database module 2) Create some fields and add one or two records. 3) Click on the Templates tab and click Save Template at the bottom of the page. (No need to alter the template) 4) Click on the Presets tab. Click Export under the 'Export as zip' section. [Test] Check to see if a dialogue box pops up asking you to save the file. 5) Save the file. 6) Create a new database activity. 7) Click on the Presets tab. in the 'Import from zip file' section choose the downloaded file and then import. [Test] Make sure that the fields are still the same as the previous database module.
    • Workaround:
      Hide

      I had a look at a difference between the code from 2.1 and master. It appears that make_upload_directory() has been switched for make_temp_directory(). Changing it back solves the problem, but I'm sure that there is probably some reason that I'm not aware of that this line of code has been changed.

      line 3145 of /mod/data/lib.php

      $exportsubdir = "temp/mod_data/presetexport/$presetname";
      make_upload_directory($exportsubdir);

      Show
      I had a look at a difference between the code from 2.1 and master. It appears that make_upload_directory() has been switched for make_temp_directory(). Changing it back solves the problem, but I'm sure that there is probably some reason that I'm not aware of that this line of code has been changed. line 3145 of /mod/data/lib.php $exportsubdir = "temp/mod_data/presetexport/$presetname"; make_upload_directory($exportsubdir);
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-31396-master

      Description

      When trying to export a preset in the database module as a zip file it doesn't create a file but instead displays an error "Not all files generated!"
      I've included a screen shot with the various warnings and stack trace.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Mar/12