Unable to open Zip archive using ArchiverZip

Created on 8 February 2017, over 7 years ago
Updated 16 February 2023, over 1 year ago

Problem/Motivation

Using Drupal\Core\Archiver\Zip to initialize a zip object from a file path, I'm receiving a ArchiverException Cannot open %file_path, returned error by ZipArchive ZIP_ER_OPEN - 11

I was able to reproduce the issue with:
Ubuntu 14.04
PHP 5.6.23
ZIP lib 1.12.5

Passing a \ZipArchive::CREATE flag to ZipArchive open() method, fixed the problem, but Drupal\Core\Archiver\Zip doesn't allow to pass any additional arguments to constructor.

Proposed resolution

To add a second optional $flags argument in Drupal\Core\Archiver\Zip __constructor() and pass by default \ZipArchive::CREATE (create the archive if not exists) flag.

πŸ› Bug report
Status

Fixed

Version

10.1 ✨

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡²πŸ‡©Moldova sdstyles

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024