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

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

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

simonr44
Copy link
Contributor

@simonr44 simonr44 commented Mar 5, 2024

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: #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

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

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@simonr44 simonr44 linked an issue Mar 5, 2024 that may be closed by this pull request
@serhiisamko091184 serhiisamko091184 added Status: Requires Code Review Needs the core team to code review Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Branch:Hotfix PR 4-8 Score given to PRs once assessed Area:Import Issues & PRs related to all things regarding Importing labels Mar 6, 2024
@serhiisamko091184
Copy link
Contributor

Hi @simonr44,

thanks for your PR!

Regards,
Serhii

@clemente-raposo clemente-raposo added Status: Requires Testing Requires Manual Testing Status: Passed Code Review Mark issue has passed code review reviewed and removed Status: Requires Code Review Needs the core team to code review labels May 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 Branch:Hotfix PR 4-8 Score given to PRs once assessed Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Passed Code Review Mark issue has passed code review reviewed Status: Requires Testing Requires Manual Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product import fails with fatal error
3 participants