Loading modules/product/src/Entity/ProductVariation.php +0 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,6 @@ class ProductVariation extends CommerceContentEntityBase implements ProductVaria // Invalidate the variations view builder and product caches. return Cache::mergeTags($tags, [ 'commerce_product:' . $this->getProductId(), 'commerce_product_variation_view', ]); } Loading modules/product/tests/src/Functional/ProductVariationFieldInjectionTest.php +9 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ class ProductVariationFieldInjectionTest extends ProductBrowserTestBase { // Have to call this save to get the cache to clear, we set the tags // correctly in a hook, but unless you trigger the submit it doesn't seem // to clear. Something additional happens on save that we're missing. // to clear. This save should invalidate the commerce_product_variation_view // tag to display product variation correctly. $this->drupalGet('admin/commerce/config/product-variation-types/default/edit/display'); $this->submitForm([], 'Save'); Loading Loading @@ -142,6 +143,13 @@ class ProductVariationFieldInjectionTest extends ProductBrowserTestBase { ]); $variation_view_display->save(); // Have to call this save to get the cache to clear, we set the tags // correctly in a hook, but unless you trigger the submit it doesn't seem // to clear. This save should invalidate the commerce_product_variation_view // tag to display product variation correctly. $this->drupalGet('admin/commerce/config/product-variation-types/default/edit/display'); $this->submitForm([], 'Save'); $this->drupalGet($this->product->toUrl()); $this->assertSession()->pageTextContains('INJECTION-CYAN'); Loading Loading
modules/product/src/Entity/ProductVariation.php +0 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,6 @@ class ProductVariation extends CommerceContentEntityBase implements ProductVaria // Invalidate the variations view builder and product caches. return Cache::mergeTags($tags, [ 'commerce_product:' . $this->getProductId(), 'commerce_product_variation_view', ]); } Loading
modules/product/tests/src/Functional/ProductVariationFieldInjectionTest.php +9 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ class ProductVariationFieldInjectionTest extends ProductBrowserTestBase { // Have to call this save to get the cache to clear, we set the tags // correctly in a hook, but unless you trigger the submit it doesn't seem // to clear. Something additional happens on save that we're missing. // to clear. This save should invalidate the commerce_product_variation_view // tag to display product variation correctly. $this->drupalGet('admin/commerce/config/product-variation-types/default/edit/display'); $this->submitForm([], 'Save'); Loading Loading @@ -142,6 +143,13 @@ class ProductVariationFieldInjectionTest extends ProductBrowserTestBase { ]); $variation_view_display->save(); // Have to call this save to get the cache to clear, we set the tags // correctly in a hook, but unless you trigger the submit it doesn't seem // to clear. This save should invalidate the commerce_product_variation_view // tag to display product variation correctly. $this->drupalGet('admin/commerce/config/product-variation-types/default/edit/display'); $this->submitForm([], 'Save'); $this->drupalGet($this->product->toUrl()); $this->assertSession()->pageTextContains('INJECTION-CYAN'); Loading