Commit 0e5a3fbf authored by mglaman's avatar mglaman Committed by bojanz

Issue #2884083 by mglaman, bradjones1: Product variant pages generated using...

Issue #2884083 by mglaman, bradjones1: Product variant pages generated using ProductVariation->toUrl() don't have the right cache contexts
parent cfc6b8b2
......@@ -3,6 +3,7 @@
namespace Drupal\commerce_product\Entity;
use Drupal\commerce\Entity\CommerceContentEntityBase;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityPublishedTrait;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityStorageInterface;
......@@ -288,6 +289,13 @@ class Product extends CommerceContentEntityBase implements ProductInterface {
}
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return Cache::mergeContexts(parent::getCacheContexts(), ['url.query_args:v']);
}
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment