localgovdrupal / localgov_microsites_base

Base theme for LocalGov Microsites
0 stars 1 forks source link

[3.x] Undefined variable $front_page_id in localgov_microsites_base_preprocess_node() #168

Closed finnlewis closed 1 year ago

finnlewis commented 1 year ago

Fresh install. Visit https://localgov-micro-1.lndo.site/welcome-your-new-site See this warning:

This might be for localgov_microsites_base, but logging here for now.


 Warning: Undefined variable $front_page_id in localgov_microsites_base_preprocess_node() (line 460 of themes/contrib/localgov_microsites_base/localgov_microsites_base.theme).

localgov_microsites_base_preprocess_node(Array, 'node', Array)
call_user_func_array('localgov_microsites_base_preprocess_node', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
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: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
ekes commented 1 year ago
460:    if ($front_page_id && $front_page_id === $node_id && $variables['view_mode'] === 'full') {

Given it's actually checking - but not safely - I think it's just a question of require isset or empty as appropriate.

markconroy commented 1 year ago

Given https://github.com/localgovdrupal/localgov_microsites_base/commit/c4d7afd0570db48510b83fe450a61cabb4f91bf7 I think this issue can be closed.

markconroy commented 1 year ago

Closing. I think this is fixed. Also, we have #152 as this issue was a general issue, not a 3.x issue.