Problem/Motivation

Blocks rendered in the tab with content that depends on taxonomy terms causes the first cached term to be displayed on all the pages.

Steps to reproduce

Create a block that depends on a specific vocabulary term
Create multiple taxonomy terms from the same vocabulary
Create a tab block
Open the first term correct results is shown
Open the second term cached result for first term is shown

Proposed resolution

Blocktabs{
  ...
  public function getCacheContexts() {
    $contexts = parent::getCacheContexts();
    foreach ($this->getTabs() as $tab) {
      $contexts = Cache::mergeContexts($tab->getCacheContexts());
    }
    return $contexts;
  }
...

The existing code uses
$contexts = Cache::mergeContexts($tab->getContexts());
Should be changed to
$contexts = Cache::mergeContexts($tab->getCacheContexts());

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Comments

nodebugger created an issue. See original summary.

nodebugger’s picture

Title: Incorect cache contexts » Incorrect cache contexts
Issue tags: +cache, +bug