Zip that contains directories cannot be imported

Created on 22 June 2023, over 1 year ago
Updated 8 July 2023, over 1 year ago

Problem/Motivation

When you create a zip file yourself that contains directories (e.g. while combining multiple export files), the import fails. The first directory gets moved in the files directory, together with all the items inside it. This make the move of the next directory/file, inside this directory, fail during the next batch run.

Exported zip files do not have this issue, as they only contain the files, not the directories.

Steps to reproduce

- Download an entity with assets as a zip file
- Extract the zip file
-- Example structure: assets/, assets/image.png, entity.yml
- Compress the extracted directory as a whole
- Import the zip file
- Note that the move of assets/image.png will throw an error saying it does not exist, as it has been moved as part of the assets folder

Proposed resolution

During the asset import, detect if this is a folder.
If it is, just prepare the directory, but don't move the source.

Alternatively, the requirement that zip file can only contains files, not directories, can also be added to the README.

πŸ› Bug report
Status

Fixed

Version

1.3

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium ducktape

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024