Problem/Motivation
PHP addFile function in zipArchive takes the second argument
'entryname' and use it to name file in the archive instead of file path. Drupal core/lib/Drupal/Core/Archiver/Zip.php add functionon on the other hand takes only one argument filepath and therefore use it to name files in archive.
Steps to reproduce
Use drupal plugin.manager.archiver and add function to create the zip archive. When you open the archive you will file path used to name the file inside the archive.
e.g /var/www/html/web/sites/default/files/yourfilename
Proposed resolution
Pass the second optional argument 'entryname' to override the filename in the archive https://www.php.net/manual/en/ziparchive.addfile.php
Remaining tasks
Testing
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3312312-10.patch | 2.41 KB | _utsavsharma |
| #10 | interdiff_7-10.txt | 2.51 KB | _utsavsharma |
| #7 | interdiff_6-7.txt | 806 bytes | ravi.shankar |
| #7 | 3312312-7.patch | 1.77 KB | ravi.shankar |
| #6 | 3312312-6.patch | 1.74 KB | heni_deepak |
Issue fork drupal-3312312
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
majid.ali commentedComment #3
majid.ali commentedComment #4
heni_deepak commented@majid.ali
can it's need to update related
class Tar?Comment #5
heni_deepak commentedComment #6
heni_deepak commentedreload #3 patch
Comment #7
ravi.shankar commentedAddressed Drupal CS issues of patch #6.
Comment #8
cilefen commentedComment #9
smustgrave commented#7 had some CI failures
Also at this time we will need a D10 version
Tagging for tests also.
Comment #10
_utsavsharma commentedPatch for 10.1.x.
Comment #14
majid.ali commentedComment #15
smustgrave commentedThis one still appears to need test coverage please
Comment #16
longwaveThe Archiver subsystem is deprecated and will be removed in 12.0.0, not sure this is worth it?