From 4d0b8cd67ef97708a27b1b028053fc02d48130f1 Mon Sep 17 00:00:00 2001 From: cewald Date: Sat, 11 Apr 2020 09:09:32 +0200 Subject: [PATCH 1/2] Add correct type matching to `getConfigurationMatchLevel` * There are usecase where the property values are either strings or numbers * By consolidate the type, using `toString` we can prevent that no configurable item is found because the option property type doesn't match --- core/modules/catalog/helpers/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/catalog/helpers/index.ts b/core/modules/catalog/helpers/index.ts index b62bea2197..5bdaaaa8ed 100644 --- a/core/modules/catalog/helpers/index.ts +++ b/core/modules/catalog/helpers/index.ts @@ -62,7 +62,7 @@ const getConfigurationMatchLevel = (configuration, variant): number => { return [].concat(configuration[configProperty]) .map(f => toString(f.id)) - .includes(variantPropertyId) + .includes(toString(variantPropertyId)) }) .filter(Boolean) .length From dcfe972cfe2afe861d6cccd064c0eec4e1c00af2 Mon Sep 17 00:00:00 2001 From: cewald Date: Sat, 11 Apr 2020 09:13:10 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b2c425d7..4445b4e226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Built-in module for detecting device type based on UserAgent with SSR support - @Fifciu - Update to `storefront-query-builder` version `1.0.0` - @cewald (#4234) - Move generating files from webpack config to script @gibkigonzo (#4236) +- Add correct type matching to `getConfigurationMatchLevel` - @cewald (#4241) ### Fixed