- Issue created by @Daniel Kulbe
Had this problem too - an occasionally vanishing navbar. A similar fix in preprocess.inc solved it.
FTR the fix that worked, tho different is:
/** * Implements template_preprocess_region(). */ function subthemename_preprocess_region(&$variables) { $variables['attributes']['id'] = "region--$region"; if ($variables['region'] == 'navbar' && function_exists('render')) { $variables['content_left'] = []; $variables['content_center'] = []; $variables['content_right'] = []; foreach ($variables['elements'] as $id => $element) { if (is_array($element)) { $block = []; if (isset($element['#id'])) { $block = Block::load($element['#id']); } elseif (isset($element['#markup'])) { $block = Block::load($id); } if ($block) { $navbar_alignment = $block->getThirdPartySetting('uikit_components', 'uikit_navbar_alignment', 'left'); switch ($navbar_alignment) { case 'left': $variables['content_left'][$id] = [ '#markup' => render($element), ]; break; case 'center': $variables['content_center'][$id] = [ '#markup' => render($element), ]; break; case 'right': $variables['content_right'][$id] = [ '#markup' => render($element), ]; break; } } } } } else { uikit_preprocess_region($variables); } }
- π§πͺBelgium yazzbe
Encountered a similar issue.
The Navbar (top region) vanished after a cache rebuild on the homepage, reappeared on basic pages, but disappeared again on views pages. The Navbar's behavior was inconsistent.
I manually applied patch #4 on Uikit 3.16 in Drupal 9.5.11, which resolved the issue.
NB: Could this fix be included in a new release, as it addresses a critical/breaking website problem?
- π§πͺBelgium yazzbe
Since this is a breaking bug, can I bump this issue to major?
Can the fix be implemented in a stable D10 release?
Many thanks
- πΊπΈUnited States dobe
I modified my preprocess.inc with the fixes from the patch and worked great! Thanks for helping find that bug.
- Status changed to RTBC
about 1 month ago 6:10pm 9 October 2024 - πΊπΈUnited States tkcent
I can confirm patch #4 works as well for Drupal 10.3.6.