Problem/Motivation

assert(, 'assert(\Drupal::service('cache_contexts_manager')->assertValidTokens($cache_contexts))') (Line: 31)
Drupal\Core\Cache\Cache::mergeContexts(Array, Array) (Line: 104)
Drupal\Core\Cache\CacheableMetadata->merge(Object) (Line: 27)
Drupal\Core\Render\BubbleableMetadata->merge(Object) (Line: 676)
Drupal\Core\Render\Renderer->mergeBubbleableMetadata(Array, Array) (Line: 326)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 288)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Replace

- { name: mobile_detect_is_mobile }

with

- { name: cache.context }

Comments

super_romeo created an issue. See original summary.

nonom’s picture

Assigned: Unassigned » nonom
nonom’s picture

Title: assert(, 'assert(\Drupal::service('cache_contexts_manager')->assertValidTokens($cache_contexts))') (Line: 31) » Cache context definition

  • nonom committed ca5027c on 8.x-2.x
    'Issue #3204264 by super_romeo: Cache context definition'
    
nonom’s picture

Thanks @super_romeo I updated the branch 8.x-2.x-dev after some test will be commited to 3.0.0

super_romeo’s picture

You are welcome!

nonom’s picture

Status: Needs review » Fixed

Committed

nonom’s picture

Status: Fixed » Closed (fixed)