salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.27k stars 2.03k forks source link

Fix #10372 - Product import fails with fatal error #10373

Open simonr44 opened 4 months ago

simonr44 commented 4 months ago

Description

When importing products via CSV file on a server running PHP 8.2 the following error is thrown when reaching the product prices within the import.

PHP Fatal error: Uncaught TypeError: mb_substr(): Argument #3 ($length) must be of type ?int, string given in /var/www/include/utils.php:5149

This is caused by the price vardefs which are in the format 26,4 with 26 representing the overall length and 4 representing the potential decimals.

In PHP8.2 this throws a fatal error and prevents the import from completing.

Issue: https://github.com/salesagility/SuiteCRM/issues/10372

Motivation and Context

When importing products, the import fails with no errors displayed through the UI, just an empty warning box.

How To Test This

Types of changes

Final checklist

serhiisamko091184 commented 4 months ago

Hi @simonr44,

thanks for your PR!

Regards, Serhii