Problem/Motivation
The module is not compatible with PhpSpreadsheet library version > 1.12.0
tested with versions 1.13.0 to 1.17.1 (current).
When trying to export, it either don't generate the file or downloads a corrupted one. It doen't raise any drupal or php error.
Steps to reproduce
Install the module (dev or 8.x-1.0) attempts to export submissions.
Proposed resolution
A workarround is to install phpspreadsheet while constraining the version prior to install the module.
composer require phpoffice/phpspreadsheet:1.12.0
As lib version 1.16.0 fixes a CVE (that seems mitigated in this case) fixing incompatibility that start at 1.13.0 would be the preferable fix.
Assuming the CVE is really irrelevant, constraining dependencies in module's composer.json, could help as a quick fix but requires to make sure of it.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | generate-the-file-or-downloads-corrupted-one-3214386-04.patch | 512 bytes | ahmad smhan |
Comments
Comment #2
prudloff commentedThanks for the report.
I am using phpspreadsheet 1.16 or 1.17 on several projects and could not reproduce the error. There might be some conditions (PHP version, row content, etc.) that triggers it.
As for CVE-2020-7776, it seems to only apply when converting an Excel file to HTML (and this module never does that). But I agree that it would be better to fix your bug than pinning an old version.
Comment #3
ericdsd commentedThanks for the reply, i tesed it on php 7.3, with several forms including very simple ones. Don't hesitate to tell me if you want me to test a patch.
Comment #4
ahmad smhan commentedThis path to solve this issue
Comment #5
ahmad smhan commentedComment #6
facine commentedIt works for me, many thanks!
Comment #7
rosk0Just tested on Drupal 9.5.3, PHP 8.0.27, webform_xlsx_export 1.1.0 and phpoffice/phpspreadsheet 1.28.0 - works as expected without this patch.
Comment #9
prudloff commentedI still can't reproduce the bug, but the patch seems harmless so I committed it.