Custom zip export failing to import on versions > 1.4.1

Created on 23 October 2023, 8 months ago
Updated 24 October 2023, 8 months ago

Problem/Motivation

We are exporting content from a "starterkit" site, expanding the zip and putting the exported files into a git repo. We then generate a zip of this repo to import with drush when creating a new site in order to set up "starter" content. We want to version the exports of this starterkit content eventually, which is why we are trying this method.

This works fine with 1.4.1, but on later versions, our generated zip will no longer import, with the error "Please check the structure of the zip file and ensure you do not have an extra parent directory." This is a zipball generated from Github, and when I unzip this and compare it to a freshly generated export using drush content:export, the files and structure contained in both are the same. I'm not sure what to look for in fixing this so would appreciate some guidance on what to look for. Thanks!

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States vinmassaro

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

Comments & Activities

  • Issue created by @vinmassaro
  • πŸ‡ΊπŸ‡ΈUnited States vinmassaro
  • πŸ‡ΊπŸ‡ΈUnited States vinmassaro
  • Status changed to Postponed: needs info 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Hi @vinmassaro,

    Do you have an example of the ZIP file?

  • Status changed to Active 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States vinmassaro

    @abramm thanks for the quick reply. You can test the generated zip from this URL: https://github.com/yalesites-org/yalesites-starterkit/zipball/main

  • Status changed to Closed: works as designed 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    There's an extra directory in your ZIP file:

    $ unzip -l ~/Downloads/yalesites-org-yalesites-starterkit-669a467.zip 
    Archive:  /home/abram/Downloads/yalesites-org-yalesites-starterkit-669a467.zip
    669a467d14c0e9aba590fc5547ba00fe4cd9d894
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/
           79  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/README.md
            0  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/assets/
            0  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/assets/2023-08/
      4557407  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/assets/2023-08/handsome-dan-ben-franklin.jpg
      3071443  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/assets/2023-08/yale-brick-in-wall-detail.jpg
            0  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/assets/2023-09/
    ...
         1112  2023-10-23 21:49   yalesites-org-yalesites-starterkit-669a467/block_content-callout-b308554c-94f2-40d5-8b3c-5e97c0d05e08.yml
    

    The paths inside ZIP file should be just assets/2023-08/handsome-dan-ben-franklin.jpg, block_content-callout-b308554c-94f2-40d5-8b3c-5e97c0d05e08.yml etc and there shouldn't be extra parent directory.
    From what I'm seeing, the module was always expecting this structure.

    I'm going to close this issue as it's working as designed, feel free to reopen if you still think this is a bug.

  • Status changed to Active 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States vinmassaro

    Expanding both zip files on MacOS was giving me the same result and I realize now is because it is opinionated in how it unzips files. I can see the difference now when using unzip at the command line. I will look at making sure we generate this zip file without the nested subdirectory. Thanks!

  • Status changed to Closed: works as designed 8 months ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Glad this helped.
    Closing out.

Production build 0.69.0 2024