You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting a fatal 500 error when upgrading the Fred extra: PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /core/xpdo/compression/pclzip.lib.php:2680
Install or upgrade an extra such as Fred that contains zero byte files.
Observed behavior
Install fails with fatal 500 error: PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /core/xpdo/compression/pclzip.lib.php:2680
This seems to be a duplicate of this issue in the xPDO repository.
The problem is the PclZip library (that is no longer maintained). PclZip is only used if your PHP installation doesn't have the zip extension (or if the system setting archive_with is explicitely set).
Bug report
Summary
I am getting a fatal 500 error when upgrading the Fred extra:
PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /core/xpdo/compression/pclzip.lib.php:2680
Is caused by empty files in the extra such as: https://github.com/modxcms/fred/blob/main/assets/components/fred/index.html
I believe this is a PHP 8+ compatibility issue as fatal errors can no longer be supressed: https://php.watch/versions/8.0/fatal-error-suppression
Step to reproduce
Install or upgrade an extra such as Fred that contains zero byte files.
Observed behavior
Install fails with fatal 500 error:
PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /core/xpdo/compression/pclzip.lib.php:2680
Related code:
revolution/core/xpdo/compression/pclzip.lib.php
Line 2678 in a296ee3
Expected behavior
Extra should install successfully.
Environment
MODX 2.8.7-pl, PHP 8.2
The text was updated successfully, but these errors were encountered: