- Issue created by @federiko_
- last update
about 1 year ago Custom Commands Failed - Issue was unassigned.
- Status changed to Needs review
about 1 year ago 10:06am 14 September 2023 - last update
about 1 year ago 30,339 pass, 2 fail This may have been fixed in Drupal 10 by 🐛 Unable to open Zip archive using ArchiverZip Fixed . Can someone verify that? Drupal 9, I think, is not going to have any more bug fix releases.
- Status changed to Postponed: needs info
about 1 year ago 11:18am 14 September 2023 - 🇫🇷France federiko_
I've tested drupal 9.5x related patch in existing issue and it seems to resolve the issue in a more dynamic/generic way ; thank you @cilefen
- Status changed to Closed: duplicate
about 1 year ago 12:13pm 14 September 2023 - 🇬🇧United Kingdom joehuggans Harrogate, UK
I'm using Drupal 10.2.2 and this issue still exists for me. Not able to apply patch from D10 issue, or this issue.
@Joe Huggans You should file a new bug report that has steps to reproduce. You cannot apply a patch from 🐛 Unable to open Zip archive using ArchiverZip Fixed because the bug fix was integrated into Drupal 10.1.
- 🇩🇪Germany M_Z
@Joe Huggans: I came across the "Using empty file as ZipArchive is deprecated" issue, too. But I found a solution to prevent the deprecation notice, that I want to share:
$options = [ 'filepath' => 'public://my-path-to-zip/my-zip-filename.zip', 'flags' => \ZipArchive::CREATE, ]; $zip = \Drupal::service('plugin.manager.archiver')->getInstance($options);
The relevant part is the 'flags' value is
\ZipArchive::CREATE
(and there is another possible option\ZipArchive::OVERWRITE
), but\ZipArchive::CREATE
seems to do both: create a non-exisiting file AND replace an existing file with a new (empty) ZIP archive (that can be filled with$zip->add(...);
afterwards).And I know that it is better to open new issues if an issue has been closed, but my solution fits perfectly to this issue and the other linked issues didn't help me. And maybe my solution is only for some PHP versions etc., but it works for me.