craftcms / commerce

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

[5.x]: inventoryTracked field not being set #3400

Closed johnnynotsolucky closed 4 months ago

johnnynotsolucky commented 4 months ago

What happened?

Description

It looks like inventoryTracked field is not being set correctly when querying variants.

Steps to reproduce

  1. Fetch a Variant that has inventoryTracked set to true: $variant = \craft\commerce\elements\Variant::find()->inventoryTracked(true)->one()
  2. Note that $variant->inventoryTracked is false.

image

Expected behavior

inventoryTracked should be true.

Actual behavior

inventoryTracked is false.

Craft CMS version

5.0@beta.5

Craft Commerce version

Branch 5.0

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL

Image driver and version

No response

Installed plugins and versions

-

lukeholder commented 4 months ago

Thanks for reporting, this is fixed for the next release.

To get the fix early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "5.0.x-dev#2de13df98e9b8a26faca4deb541e10db8f540556 as 5.0.0-beta.1",
  "...": "..."
}

Then run composer update.

Will update here once the next release is out.