Re: file upload issues with SuiteCRM V7/8 (or apache24 and php8 diff FreeBSD vs Debian)

From: Dale Scott <dalescott_at_shaw.ca>
Date: Sat, 05 Mar 2022 22:06:00 UTC
> From: "Mario Lobo" <lobo@bsd.com.br>
> To: "Dale Scott (dalescott@shaw)" <dalescott@shaw.ca>
> Cc: "freebsd-questions" <freebsd-questions@freebsd.org>
> Sent: Saturday, March 5, 2022 12:40:16 PM
> Subject: Re: file upload issues with SuiteCRM V7/8 (or apache24 and php8 diff
> FreeBSD vs Debian)

> On Sat, Mar 5, 2022, 01:33 Dale Scott < [ mailto:dalescott@shaw.ca |
> dalescott@shaw.ca ] > wrote:

>> On Mar 1, 2022 6:21 PM, Waitman Gobble < [ mailto:gobble.wa@gmail.com |
>> gobble.wa@gmail.com ] > wrote:

>>> OK. The latest release they have on their site is 8.x something but
>>> there's no mention of it on their git repository, I wonder if they
>>> haven't yet released 8.x for PHP 8 to "community".

>> Good news. The error had nothing to do with FreeBSD and I had a patch the next
>> day. It was nice to see the community response. Thanks again for your help
>> Waitman. Cheers, Dale

> Hi Dale.

> Could you please post the patch, or a link to it?

Sure. Sorry for my oversight. 

The patch replaces line 267 in download.php and line 269 modules/Documents/Document.php, in both SuiteCRM-7.12.4 and . In SuiteCRM-8.0.3 (in SuiteCRM-8.0.3 the files are identical but have been moved to .../legacy/.... directory). 

E.g. in download.php, replace: 

if (in_array($row['file_ext'], $sugar_config['allowed_preview'], true)) { 

with: 

if (isset($row['file_ext'], $sugar_config['allowed_preview']) && in_array($row['file_ext'], $sugar_config['allowed_preview'], true)) { 

Link to topic in the SuiteCRM forum with reply from project maintainer Matt with patch: [ https://community.suitecrm.com/t/php-fatal-error-after-file-upload-on-v7-and-v8-solved/84177 | https://community.suitecrm.com/t/php-fatal-error-after-file-upload-on-v7-and-v8-solved/84177 ] 

Link to issue reported to SuiteCRM GitHub repo: [ https://github.com/salesagility/SuiteCRM/issues/9530 | https://github.com/salesagility/SuiteCRM/issues/9530 ] 

Cheers, 
Dale