Skip to content

Extracting a document for minification is missing \ZipArchive::CREATE flag #75

Description

@ideb

Problem/Motivation

Deepl support document minification: https://github.com/DeepLcom/deepl-php?tab=readme-ov-file#document-minification

However, extracting the document for minification may fail because the ZipArchive->open call is missing the \ZipArchive::CREATE flag

Steps to reproduce

  1. Create a docx with a single word 'test'
  2. Call \DeepL\Translator::translateDocument with $options[TranslateDocumentOptions::ENABLE_DOCUMENT_MINIFICATION]
  3. Notice the call results in an exception:
    Failed to open ... as ZIP file.

Proposed resolution

Add \ZipArchive::CREATE flag to \DeepL\DocumentMinifier::extractZipTo

User interface changes

None

API changes

None

Data model changes

None

Activity

  1. added a commit that references this issue on Dec 12, 2025
  2. ideb commented on Dec 29, 2025

    @ideb
    Author

    The source file was probably missing when requesting the translation. I'll close the issue.

  3. JanEbbing commented on Dec 29, 2025

    @JanEbbing
    Contributor

    I'll look into this though, we should fail with a better error message when this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions