Files doubling up in an export

Bug #1873118 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned

Bug Description

When doing a full export we can get files doubled up appearing in export_info/files/ directory and also subdirectories under this directory.

It looks like if the file is used in a page / block it gets put here but at the same time the Files area of the user's Content section is added in with the same folder structure.

So, for example if I add a coverimage, img1.jpg, to a page it gets saved in the 'Cover images' folder in files.

When I export the user I get a copy of img1.jpg in export_info/files/ directory because of it's association to the exported page and another copy in export_info/files/Cover images/ because of it's relation to the files directory.

we used to export files in their directories to avoid name clashes - but now that we export files prefixed with their fileid we don't need to worry about that so we should export all files into export_info/files/ directory without bothering with the subdirectories and have the generated files html page point to export_info/files/ instead

Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 20.04rc1
Revision history for this message
Robert Lyon (robertl-9) wrote :

The problem with this is if you have large files then it doubles up the size of the export zip which makes things take longer both exporting and importing

Changed in mahara:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Cecilia,

I've assigned this to you to look into how much work it will be to stop the duplication of files in the zip file.

If it is a lot of work to fix then update the bug report with why that is the case and we can push it out to 20.10.

Cheers
Robert

Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10913

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.04rc1 → 20.04rc2
Changed in mahara:
milestone: 20.04rc2 → 20.10.0
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :

We are using two different systems to export files in html/leap2A (I'm thinking of pdf as a special case of html)

1. Folder structure, as it is in the original account (old system)
2. Single folder, having all files inside one folder adding the artefact id at the beginnigng of the file name so there are no clashes

The problem with this is that we have most files duplicated, making the export file almost double the size it should be.
We need to decide which system we want to keep, for that we need to consider:

If we want to have only the single folder approach, we will be missing the folder structure. This is what we use when importing leap2A and when viewing the site as html. We would need to display all files inside the same folder that can be confusing to the user, specially if there are lots of files. We would need to remove the code that already creates the folder structure, also the one that imports this structure and fix the links to point to the correct place.

If we want to have the older system, the folder structure, we would need to adapt the code that looks for the files as id+name to looke for them in the folder structure.

I'm not sure why we chose to have a new system, but we need to define which one is best.

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/11204

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11204
Committed: https://git.mahara.org/mahara/mahara/commit/1fe25a7356e92de5739986e5a80a6cabd2a9830e
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 1fe25a7356e92de5739986e5a80a6cabd2a9830e
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Sep 1 18:03:30 2020 +1200

Bug 1873118: files folder duplicated in export_info

When exporting a portfolio, the zip file generated has a files
directory duplicated with exact same content

export_info/files/
export_info/files//
have the same content because we are adding an extra '/'

behatnotneeded

Change-Id: Ia29011b0d5816c62f039532b78a47dcc0b888c94

Changed in mahara:
milestone: 20.10.0 → 21.04.0
Changed in mahara:
assignee: Cecilia Vela Gurovic (ceciliavg) → nobody
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "main" branch: https://reviews.mahara.org/12079

Changed in mahara:
assignee: nobody → Dianne Tennent (dianne-t)
Changed in mahara:
assignee: Dianne Tennent (dianne-t) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.