- Issue created by @Liam McDermott
- Status changed to Needs review
about 1 year ago 10:22am 20 September 2023 - 🇬🇧United Kingdom catch
I just ran into this. The problem is that the module doesn't use Drupal's stream wrapper API fully and assumes everything is in
public://
.This patch works locally for me with the local stream wrapper, but I'm uploading it here so it's easier to then merge into our dev/staging environment with a real s3 stream wrapper, so might need further updates before it actually works.
- 🇬🇧United Kingdom catch
OK this should be a better patch:
1. Removes the hard-coding of 'public://' and uses whichever stream is configured for the field.
2. Always copies the zip to the temporary directory before extracting, this is for compatibility with the s3fs 'public files takeover' setting and similar situations of replacing the public:// stream wrapper.
Has only had light testing so additional reviews will be welcome, although we'll be testing it ourselves this week a bit more.
- 🇬🇧United Kingdom catch
Looks like there's an error calling extractTo() on s3 as well, per 🐛 Extract Zip files Active . The recommendation on that issue is to extract to temporary directory and copy from there. Attaching an untested patch which implements that.
- 🇬🇧United Kingdom catch
Fixing a case issue with the use statement and setting the directory up correctly.
- 🇬🇧United Kingdom catch
Another change - need to keep the resultant directory in the public files directory.
This issue will also need an update for changes in 3.1.x
- 🇬🇧United Kingdom catch
Restricting the scope of #11 requires one more change to be reverted.
- 🇻🇳Vietnam linhnm
Change the extract_dir to match with default unzipPackage destination