Skip to content

Configurable Product Links Validation Bug when int value is 0 #13210

@davidverholen

Description

@davidverholen

Preconditions

  1. Magento 2.4-develop
  2. Attribute with Source Model having 0 as one value
  3. Create a simple Product with attribute value 0 selected

Steps to reproduce

  1. Create configurable containing the simple product via REST Api

Expected result

  1. Configurable Product is created with the linked simple product

Actual result

  1. Exception thrown: Product with id "%1" does not contain required attribute "%2"."

The validation of the product links attributes from the configurable-product module is not type-safe which leads to a validation error when the value is (int)0
See: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/ConfigurableProduct/Model/Plugin/ProductRepositorySave.php#L103

Metadata

Metadata

Labels

Component: ApiUse with concrete module component label E.g. "Component: Api" + "Catalog"Component: CatalogComponent: ConfigurableProductComponent: EavFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Reproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions