Skip to content
Snippets Groups Projects
Commit 0e5a3fbf authored by Matt Glaman's avatar Matt Glaman Committed by Bojan Živanović
Browse files

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
No related branches found
Tags 10.3.6
No related merge requests found
......@@ -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}
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment