craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[5.x]: Multi-Store Inventory not loading #3696

Open AndrewMac opened 3 days ago

AndrewMac commented 3 days ago

What happened?

Inventory seemed to be working okay when I had just one store, but stopped working when I added a second store. The screen just sits there with the spinning loading icon.

I also tried an inventory transfer and got an error: TypeError craft\commerce\collections\UpdateInventoryLevelCollection::craft\commerce\collections{closure}(): Argument #1 ($updateInventoryLevel) must be of type craft\commerce\models\inventory\UpdateInventoryLevel, craft\commerce\models\inventory\UpdateInventoryLevelInTransfer given

Craft CMS version

Pro 5.4.6

Craft Commerce version

Pro 5.1.2

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

linear[bot] commented 3 days ago

PT-2180 [5.x]: Multi-Store Inventory not loading

lukeholder commented 3 days ago

Hi, could you expand on "The screen just sits there with the spinning loading icon." which screen is that?

Could you send your DB backup, composer.json and composer.lock to support@craftcms.com and reference this issue please? Include the steps to reproduce.

We can then take a look at trying to reproduce what is causing the issue. Thanks

AndrewMac commented 3 days ago

The main Commerce: Inventory screen. I will ask my client about sending the DB, but they have not allowed that in the past.

lukeholder commented 3 days ago

No worries, can you run the php craft gc and php craft resave/products commands and see if that fixes the issue?

AndrewMac commented 3 days ago

I ran the gc command without issue, but when I tried "ddev craft resave/products" it told me that "No products exist for that criteria" (resaving entries worked just fine, though?). That's all a bit strange, though, because the same command works okay on a brand-new Craft/Commerce-only site I just set up to test this issue for incompatible plugins. I still get the spinning wheel on the project site, and with the resave command not working I can't see if that fixes things.

I can also report that the inventory screen loads okay on that new Craft/Commerce-only site I just set up. But the inventory transfer is still giving the error. Just to make sure I read the docs correctly: I set up the transfer, then tried to set the transfer to 'pending'. And that's when the TypeError I reported above kicks in.