Excel and Word (.xlsx and .docx) document upload not working #5301

Open
opened 2026-02-20 16:32:34 -05:00 by deekerman · 2 comments
Owner

Originally created by @shubham-pawar on GitHub (Jan 31, 2025).

Issue

I had the same problem with SuiteCRM 7.14.1
Using php 7.4: no problem, the upload is OK
Using php 8.2: upload not working. PHP error:
PHP Fatal error: Uncaught ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator in /home/…/…/…/vendor/zf1/zend-xml/library/Zend/Xml/Security.php:172

Possible Fix

Line 172 is: version_compare(PHP_VERSION, ‘5.6’, ‘gte’)
In fact, ‘gte’ is not correct.
In php 8.2, the only correct parameters are: < , lt , <= , le , > , gt , >= , ge , == , = , eq , != , <>,‘ne’
(See PHP: version_compare - Manual)
So I replaced line 172 by: version_compare(PHP_VERSION, ‘5.6’, ‘>=’)
and upload was OK

Steps to Reproduce the Issue

1.  It is a fresh installation but it seems that I cannot upload excel (xlsx) or word (docx) files under each module.
2. I can upload documents like xls, doc but no xlsx and docx files types.
...

Context

No response

Version

7.14

What browser are you currently using?

Chrome

Browser Version

130.0

Environment Information

PHP 8.2

Operating System and Version

Ubuntu 22.04

Originally created by @shubham-pawar on GitHub (Jan 31, 2025). ### Issue I had the same problem with SuiteCRM 7.14.1 Using php 7.4: no problem, the upload is OK Using php 8.2: upload not working. PHP error: PHP Fatal error: Uncaught ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator in /home/…/…/…/vendor/zf1/zend-xml/library/Zend/Xml/Security.php:172 ### Possible Fix Line 172 is: version_compare(PHP_VERSION, ‘5.6’, ‘gte’) In fact, ‘gte’ is not correct. In php 8.2, the only correct parameters are: < , lt , <= , le , > , gt , >= , ge , == , = , eq , != , <>,‘ne’ (See [PHP: version_compare - Manual](https://www.php.net/manual/en/function.version-compare.php)) So I replaced line 172 by: version_compare(PHP_VERSION, ‘5.6’, ‘>=’) and upload was OK ### Steps to Reproduce the Issue ```bash 1. It is a fresh installation but it seems that I cannot upload excel (xlsx) or word (docx) files under each module. 2. I can upload documents like xls, doc but no xlsx and docx files types. ... ``` ### Context _No response_ ### Version 7.14 ### What browser are you currently using? Chrome ### Browser Version 130.0 ### Environment Information PHP 8.2 ### Operating System and Version Ubuntu 22.04
Author
Owner

@SuiteBot commented on GitHub (Jan 31, 2025):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/excel-and-word-xlsx-and-docx-document-upload-not-working/85231/18

@SuiteBot commented on GitHub (Jan 31, 2025): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/excel-and-word-xlsx-and-docx-document-upload-not-working/85231/18
Author
Owner

@pgorod commented on GitHub (Jan 31, 2025):

That's in 3rd party code...

https://github.com/zf1/zend-xml/issues/2

... which looks very unmaintained 😓

@pgorod commented on GitHub (Jan 31, 2025): That's in 3rd party code... https://github.com/zf1/zend-xml/issues/2 ... which looks very unmaintained 😓
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5301
No description provided.