Commit f6e43807 authored by Kostia Bohach's avatar Kostia Bohach Committed by Jonathan Sacksick
Browse files

Issue #3285023 by _shY, abramm: Remove the "commerce_product_variation_view"...

Issue #3285023 by _shY, abramm: Remove the "commerce_product_variation_view" cache tag from ProductVariation::getCacheTagsToInvalidate().
parent 668ae574
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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',
    ]);
  }

+9 −1
Original line number Diff line number Diff line
@@ -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');

@@ -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');