Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product import fails with fatal error #10372

Open
simonr44 opened this issue Mar 5, 2024 · 0 comments · May be fixed by #10373
Open

Product import fails with fatal error #10372

simonr44 opened this issue Mar 5, 2024 · 0 comments · May be fixed by #10373
Labels
Area:Import Issues & PRs related to all things regarding Importing Area: PHP8 Issues & PRs related to the CRM when using PHP8 Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type: Bug Bugs within the core SuiteCRM codebase

Comments

@simonr44
Copy link
Contributor

simonr44 commented Mar 5, 2024

Issue

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.

Expected Behavior

The CSV import process should complete as expected.

Actual Behavior

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

Possible Fix

Fix branch to follow

Steps to Reproduce

  1. Prepare an import CSV with the required fields and at least one price
  2. Import the CSV
  3. The import will fail and the 500 fatal error logged

Context

Relatively high priority as it impacts users importing products

Your Environment

  • SuiteCRM Version used: 7.14.2
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome Version 122.0.6261.94 (Official Build) (64-bit)
  • Environment name and version (e.g. MySQL, PHP 7): PHP 8.2
  • Operating System and version (e.g Ubuntu 16.04): Debian 11
@simonr44 simonr44 changed the title Product import failis with fatal error Product import fails with fatal error Mar 5, 2024
simonr44 added a commit to simonr44/SuiteCRM that referenced this issue Mar 5, 2024
@johnM2401 johnM2401 added Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Area: PHP8 Issues & PRs related to the CRM when using PHP8 Area:Import Issues & PRs related to all things regarding Importing Severity: Moderate Key function failed, but no or little impact Type: Bug Bugs within the core SuiteCRM codebase labels Mar 5, 2024
@simonr44 simonr44 linked a pull request Mar 5, 2024 that will close this issue
6 tasks
@simonr44 simonr44 linked a pull request Mar 5, 2024 that will close this issue
6 tasks
@gemartin21 gemartin21 added the Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Import Issues & PRs related to all things regarding Importing Area: PHP8 Issues & PRs related to the CRM when using PHP8 Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Moderate Key function failed, but no or little impact Status:Fix Proposed A issue that has a PR related to it that provides a possible resolution Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants