Closed charlesbrandt closed 6 years ago
The way we're declaring cache contexts for blocks in our custom modules is tripping over this bug. Trying to view a revision happens over a different route, and our declared cache context is only for the node view. This means, as written, our block does not have a cache context for the node.
Drupal is supposed to not crash when this happens. It's supposed to execute the block with no caching. However, there are bugs that have been outstanding for years on this topic.
https://www.drupal.org/project/drupal/issues/2620126 https://www.drupal.org/project/drupal/issues/2677162
All this means that our custom modules' blocks must be very careful about cache context declarations. They must:
Revisions are now viewable
When looking at the node revisions page in Drupal, clicking on one of the times yields:
The website encountered an unexpected error. Please try again later.Drupal\Component\Plugin\Exception\ContextException: Required contexts without a value: node. in Drupal\Core\Plugin\Context\ContextHandler->applyContextMapping() (line 96 of core/lib/Drupal/Core/Plugin/Context/ContextHandler.php).
For example: https://bloomington.in.gov/node/110/revisions/12401/view