Using empty file as ZipArchive is deprecated

Created on 14 September 2023, about 1 year ago
Updated 15 May 2024, 6 months ago

Problem/Motivation

Deprecated function : ZipArchive::open(): Using empty file as ZipArchive is deprecated dans Drupal\Core\Archiver\Zip->__construct() (/app/web/core/lib/Drupal/Core/Archiver/Zip.php ligne 31)

Steps to reproduce

Install Drupal 9.5

$archive_path = 'private://example-zip-archive.zip';
\Drupal::service('file_system')->saveData($archive_path) 
\Drupal::service('plugin.manager.archiver')->getInstance(['filepath' => $archive_path]);

Proposed resolution

Add flags to open() function :
if ($this->zip->open($file_path, ZipArchive::OVERWRITE|ZipArchive::CREATE) !== TRUE) {
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/lib/Drupal/C...

🐛 Bug report
Status

Closed: duplicate

Version

9.5

Component
Base 

Last updated about 2 hours ago

Created by

🇫🇷France federiko_

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

Comments & Activities

Production build 0.71.5 2024