From 8394964c7d0215f12026f1958169350d39c3bce5 Mon Sep 17 00:00:00 2001 From: tkostuch Date: Wed, 30 Oct 2019 14:13:51 +0100 Subject: [PATCH 1/2] remove product mutate when assign product --- core/modules/catalog/store/product/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/catalog/store/product/actions.ts b/core/modules/catalog/store/product/actions.ts index 535a6e01af..ea43a26209 100644 --- a/core/modules/catalog/store/product/actions.ts +++ b/core/modules/catalog/store/product/actions.ts @@ -307,7 +307,7 @@ const actions: ActionTree = { } if (configuration) { let selectedVariant = configureProductAsync(context, { product: product, configuration: configuration, selectDefaultVariant: false }) - Object.assign(product, omit(selectedVariant, ['visibility'])) + product = Object.assign({}, product, omit(selectedVariant, ['visibility'])) } if (product.url_path) { rootStore.dispatch('url/registerMapping', { @@ -430,7 +430,7 @@ const actions: ActionTree = { // todo: probably a good idea is to change this [0] to specific id const selectedVariant = configureProductAsync(context, { product: prod, configuration: { sku: options.childSku }, selectDefaultVariant: selectDefaultVariant, setProductErorrs: true }) if (selectedVariant && assignDefaultVariant) { - prod = Object.assign(prod, selectedVariant) + prod = Object.assign({}, prod, selectedVariant) } } else if (!skipCache || (prod.type_id === 'simple' || prod.type_id === 'downloadable')) { if (setCurrentProduct) context.dispatch('setCurrent', prod) From bb7feb27f7afcc0bd676e7b6a29dbd50cb7e825c Mon Sep 17 00:00:00 2001 From: tkostuch Date: Wed, 30 Oct 2019 14:27:40 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c30940fc74..1ee0467df0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.10.5] - unreleased + +### Fixed +- disable product mutation when assigning product variant - @gibkigonzo (#3735) + ## [1.10.4] - 18.10.2019 ### Fixed