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

Export related files in database activity export

    XMLWordPrintable

Details

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-40084-master
    • Hide

      Testing scenario 1. Export CSV and ODS

      1. Create a course
      2. Create a database activity and add two fields, one of the type "picture" and one of the type "file"
      3. Add new entry by uploading a file "file.txt" and a picture "picture.png"
      4. Add new entry by uploading a file "file2.txt" a picture "picture.png" (same name for being able to test if duplicate file names are handled properly when exporting)
      5. Go to "Actions"->"Export entries", choose "CSV"
      6. Confirm you can choose both the file and the picture field
      7. Confirm the option "Include files in export" is checked
      8. Click "Export entries"
      9. You will be prompted to download zip archive containing the csv file and a directory "files" including the picture and the file you uploaded.
      10. Confirm the subdirectory "files" in the zip archive contains files "file.txt", "file2.txt", "picture.png" and "picture_1.png"
      11. Confirm that the csv file in the zip archive root directory contains the correspoding filenames in the file/picture field column
      12. Do the same like described until here, but instead of csv use ods export.
      13. Confirm the result with ODS is the same as with the CSV.

      Testing scenario 2. Import entries

      1. Go to "Actions"->"Import entries"
      2. Upload the zip archive (the one with csv, not the ods) into the file manager
      3. Click "Submit"
      4. Go back to the database page, for example List view
      5. Confirm that there are 2 new database entries with same information than the two original ones with one exception: The 4th entry will have the same picture than the second one (expected), but the filename will differ: "picture.png" vs "picture_1.png"
      Show
      Testing scenario 1. Export CSV and ODS Create a course Create a database activity and add two fields, one of the type "picture" and one of the type "file" Add new entry by uploading a file "file.txt" and a picture "picture.png" Add new entry by uploading a file "file2.txt" a picture "picture.png" (same name for being able to test if duplicate file names are handled properly when exporting) Go to "Actions"->"Export entries", choose "CSV" Confirm you can choose both the file and the picture field Confirm the option "Include files in export" is checked Click "Export entries" You will be prompted to download zip archive containing the csv file and a directory "files" including the picture and the file you uploaded. Confirm the subdirectory "files" in the zip archive contains files "file.txt", "file2.txt", "picture.png" and "picture_1.png" Confirm that the csv file in the zip archive root directory contains the correspoding filenames in the file/picture field column Do the same like described until here, but instead of csv use ods export. Confirm the result with ODS is the same as with the CSV. Testing scenario 2. Import entries Go to "Actions"->"Import entries" Upload the zip archive (the one with csv, not the ods) into the file manager Click "Submit" Go back to the database page, for example List view Confirm that there are 2 new database entries with same information than the two original ones with one exception: The 4th entry will have the same picture than the second one (expected), but the filename will differ: "picture.png" vs "picture_1.png"

    Description

      It is currently not possible to export files from a file field in a database. Is this something that could be looked into and improved?

      All the files could be zipped up and referenced in the accompanying csv file - similar to how a course backup works maybe.

      Attachments

        1. export_xmlformat.png
          export_xmlformat.png
          21 kB
        2. import_entries_strings.png
          import_entries_strings.png
          68 kB
        3. includefilesinexport.png
          includefilesinexport.png
          15 kB
        4. MDL-40084.png
          MDL-40084.png
          1.60 MB
        5. zipformat_newissue.png
          zipformat_newissue.png
          18 kB

        Issue Links

          Activity

            People

              phmemmel PhMemmel
              curtiskennington Curtis Kennington
              Laurent David Laurent David
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              25 Vote for this issue
              Watchers:
              35 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 6 minutes
                  1d 6m

                  Clockify

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