-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Fixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 release
Description
Preconditions
- Magento Commerce 2.2.5 (version of module-catalog is 102.0.5)
Steps to reproduce
- Add attribute options by calling \Magento\Catalog\Model\Product\Attribute\OptionManagement::add
- Add attribute option that has admin scope value '01'.
- Add another option for same attribute that has admin scope value '1'.
Expected result
- Both options can be found from table eav_attribute_option_value.
Actual result
- Only option with value '01' exists in DB.
Origin of the issue
| if (in_array($option->getLabel(), $currentOptions)) { |
In_Array comparison fails due to fact that comparison is not done "strictly".
Suggested fix
if (in_array((string)$option->getLabel(), $currentOptions, true)) {
Metadata
Metadata
Assignees
Labels
Fixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 release