Hi there,
I get an error when I try to create a context which should switch active theme as reaction whilst also using the current theme condition.
How to reproduce the error
- Create a new context "context A"
- Specify a theme condition (where theme is Bartik etc.)
- Choose a reaction such a adding body class.
- Save and continue
- ---
- Create a new context "context B"
- Specify a path by using the request path condition
- Choose a theme by using the Theme reaction
- Save and continue (crashes here)
What happens while saving...
A new context will be created but with the following issues:
- The context ThemeSwitcherNegotiator class tries to get current contexts to set theme
- the current condition context for theme condition is called recursively as result.
Final result
The Theme Manager tries to define the active theme by calling the ::applies() method for every theme negotiator. When this method is called for Context Theme Switcher Negotiator, it tries to discover itself the active theme (this means the Theme Manager will start again the theme discovery logic ending in calling again the applies method of the Context Theme Switcher Negotiator), by causing an infinite loop on every page of your website.
The website encountered an unexpected error. Please try again later.
Error: Maximum function nesting level of '256' reached, aborting! in Drupal\Core\Condition\ConditionPluginBase->defaultConfiguration() (line 107 of core/lib/Drupal/Core/Condition/ConditionPluginBase.php).
Drupal\Core\Condition\ConditionPluginBase->defaultConfiguration() (Line: 73)
Drupal\system\Plugin\Condition\CurrentThemeCondition->defaultConfiguration() (Line: 100)
Drupal\Core\Condition\ConditionPluginBase->setConfiguration(Array) (Line: 37)
Drupal\Core\Condition\ConditionPluginBase->__construct(Array, 'current_theme', Array) (Line: 51)
Drupal\system\Plugin\Condition\CurrentThemeCondition->__construct(Array, 'current_theme', Array, Object, Object) (Line: 65)
Drupal\system\Plugin\Condition\CurrentThemeCondition::create(Object, Array, 'current_theme', Array) (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('current_theme', Array) (Line: 58)
Drupal\Core\Condition\ConditionManager->createInstance('current_theme', Array) (Line: 81)
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('current_theme') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('current_theme') (Line: 26)
Drupal\Core\Condition\ConditionPluginCollection->get('current_theme') (Line: 148)
Drupal\Component\Plugin\LazyPluginCollection->getIterator() (Line: 302)
Drupal\context\ContextManager->applyContexts(Object) (Line: 276)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 107)
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate() (Line: 74)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\context\ContextManager->resolveConditions(Object, 'and') (Line: 289)
Drupal\context\ContextManager->evaluateContextConditions(Object) (Line: 201)
Drupal\context\ContextManager->evaluateContexts() (Line: 189)
Drupal\context\ContextManager->getActiveContexts() (Line: 220)
Drupal\context\ContextManager->getActiveReactions('theme') (Line: 56)
Drupal\context\Theme\ThemeSwitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 403)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 74)
Drupal\Core\Render\ElementInfoManager->getInfo('form') (Line: 810)
Drupal\Core\Form\FormBuilder->prepareForm('context_edit_form', Array, Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm('context_edit_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->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: 665)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Proposed solution
Let's add an "evaluated" property within the ThemeSwitcherNegotiator class to be used as a flag to avoid this kind of infinite recursion.
Comment | File | Size | Author |
---|---|---|---|
#2 | maximum-function-nesting-level-for-contexts-with-theme-reactions-3024989-2.patch | 1.96 KB | aronne |
Comments
Comment #2
aronne CreditAttribution: aronne at bmeme commentedHere it is the patch which is working fine for me.
Hope it helps.
Regards
Comment #3
brandonratz CreditAttribution: brandonratz as a volunteer commented#2 Patch addressed a similar issue for me.
Comment #4
bzoks CreditAttribution: bzoks at Agiledrop - Your Trusted Drupal Teammates commentedI was not able to reproduce the issue in Drupal 8.7 using module version 8.x-4.x-dev and also not on module version 8.x-4.0-beta2.
Are you sure you used one of those versions?
Patch #2 does solve some other issue, which it seems is not reported separately yet
Notice: Undefined index: theme in Drupal\context\Theme\ThemeSwitcherNegotiator->applies() (line 58 of modules/contrib/context/src/Theme/ThemeSwitcherNegotiator.php)
Part of a patch that fixes this is:
If the original issue won't be reproducible, this other issue should be reported and solved separately.
Best regards,
Bostjan
Comment #5
silverham CreditAttribution: silverham at EY Digital commentedI can confirm there is an issue when the condition "current theme (System)" is used at the same time as a "theme" reaction.
See line in back trace:
Drupal\system\Plugin\Condition\CurrentThemeCondition->evaluate()
This causes a recursive loop:
$this->themeManager->getActiveTheme()
ThemeSwitcherNegotiator->applies()
ThemeSwitcherNegotiator->getActiveReactions()
-
The patch prevents a second call to find the active theme if it has already tried.
I have tested it and confirmed it works good.
Comment #6
silverham CreditAttribution: silverham at EY Digital commentedComment #7
paulocsThanks @silverham! I could reproduce it too.
I'm not sure if it is in the scope of the issue, but if one context has condition Current Theme = Bartik and reaction Body class = "test-class" and the other context has condition Request Path = and reaction Theme = Claro, the class "test-class" is added in the body tag on the front page.
Comment #9
paulocsI committed it in dev-branch. About my comment #7, in my opinion it is working as it suppose to be.
Thanks @all :)
Comment #11
silverham CreditAttribution: silverham at EY Digital commentedThanks @paulocs !! :-)