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

[5.x]: Regression in 5.2.8 - Argument #1 ($id) must be of type int, null given - Inventory.php #3849

Open
sunscreem opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels
bug commerce5 Craft Commerce ℹ️ status: need more info When waiting for user to supply database or more information.

Comments

@sunscreem
Copy link

What happened?

Description

After upgrading from 5.2.7 to 5.2.8, when running a FeedMe run to create a new product, it fails to create fully.

The product is created but the variant isn't and feedme throws the following error:

craft\commerce\services\Inventory::getInventoryItemById(): Argument #1 ($id) must be of type int, null given, called in /home/jamiesoncarry/site/[jamieson-carry.com/vendor/craftcms/commerce/src/services/Inventory.php](http://jamieson-carry.com/vendor/craftcms/commerce/src/services/Inventory.php) on line 81 - Inventory.php: 88

I've tried to debug this myself by going through the changes introduced in 5.2.8 (compare is here) but reverseing each of these in turn and I've been unable to find the exact problem.

Steps to reproduce

  1. Install Commerce 5.2.8
  2. Try to create a new product via feed me.

I can send over a screen grab of the feedme settings and a copy of the json from the product I'm trying to create if needed, however I've a feeling you'll spot the issue that I couldn't.

Craft CMS version

5.5.7

Craft Commerce version

5.2.8

PHP version

8.3.9

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@lukeholder
Copy link
Member

Hi @sunscreem sorry to see you are having an issue here and for our delay getting back to you.

I can't seem to replicate the error. It is likely due to the state your projects data is in and the import data you are trying to import.

Could you send your database backup, composer.json and composer.lock as well as an example of the data you are trying to import so we can try and reproduce it ourselves?

Send it through to [email protected] and reference this issue and we will take a look.

Thanks.

@lukeholder lukeholder self-assigned this Feb 3, 2025
@lukeholder lukeholder added the ℹ️ status: need more info When waiting for user to supply database or more information. label Feb 3, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce5 Craft Commerce ℹ️ status: need more info When waiting for user to supply database or more information.
Projects
None yet
Development

No branches or pull requests

2 participants