Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / workspaces / src / WorkspacesServiceProvider.php
diff --git a/web/core/modules/workspaces/src/WorkspacesServiceProvider.php b/web/core/modules/workspaces/src/WorkspacesServiceProvider.php
new file mode 100644 (file)
index 0000000..685575f
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+namespace Drupal\workspaces;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ServiceProviderBase;
+
+/**
+ * Defines a service provider for the Workspaces module.
+ */
+class WorkspacesServiceProvider extends ServiceProviderBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function alter(ContainerBuilder $container) {
+    // Add the 'workspace' cache context as required.
+    $renderer_config = $container->getParameter('renderer.config');
+    $renderer_config['required_cache_contexts'][] = 'workspace';
+    $container->setParameter('renderer.config', $renderer_config);
+  }
+
+}