After updating the theme to 8.x-1.4, I'm getting this error when I view my homepage:
Notice: Undefined offset: 2 in drupal8_zymphonies_theme_preprocess_page()
(line 109 of /home/[user]/public_html/themes/drupal8_zymphonies_theme/drupal8_zymphonies_theme.theme)
#0 /home/[user]/public_html/core/includes/bootstrap.inc(584): _drupal_error_handler_real(8, 'Undefined offse...', '/home/[user]...', 109, Array)
#1 /home/[user]/public_html/themes/drupal8_zymphonies_theme/drupal8_zymphonies_theme.theme(109): _drupal_error_handler(8, 'Undefined offse...', '/home/[user]...', 109, Array)
#2 /home/[user]/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(287): drupal8_zymphonies_theme_preprocess_page(Array, 'page', Array)
#3 /home/[user]/public_html/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('page', Array)
#4 /home/[user]/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#5 /home/[user]/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#6 /home/[user]/public_html/sites/default/files/php/twig/5c5c78df8c29f_html.html.twig_zinhPdJ9W1hYdo3dSVetuZiCw/7THmmCfvy5m_grCQokgK5KI9EGIY1JWOtGSqZXVMQ1c.php(88): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#7 /home/[user]/public_html/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_5228f464b5c7f79754755fbde75285faa2f3d46abe33d4998c496d83de624694->doDisplay(Array, Array)
#8 /home/[user]/public_html/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#9 /home/[user]/public_html/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#10 /home/[user]/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#11 /home/[user]/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/drupal8_...', Array)
#12 /home/[user]/public_html/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('html', Array)
#13 /home/[user]/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#14 /home/[user]/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(147): Drupal\Core\Render\Renderer->render(Array)
#15 /home/[user]/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#16 /home/[user]/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(148): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#17 /home/[user]/public_html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#18 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#19 /home/[user]/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#20 /home/[user]/public_html/vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#21 /home/[user]/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /home/[user]/public_html/modules/bat_api/src/StackMiddleware/BatApiMiddleware.php(44): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /home/[user]/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /home/[user]/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /home/[user]/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /home/[user]/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /home/[user]/public_html/modules/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /home/[user]/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\services\StackMiddleware\FormatSetter->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /home/[user]/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/[user]/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/[user]/public_html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /home/[user]/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#33 {main}.| Comment | File | Size | Author |
|---|---|---|---|
| #10 | undefined_offset_error_after_updating-3031435-10.patch | 588 bytes | karimb |
Comments
Comment #2
carnerik commentedComment #3
carnerik commentedAfter more Googling, I found a similar issue for the Sales Zymphonies Theme. I manually applied the patch from comment #2 for that issue to this theme and it seems to have fixed the problem. Would someone be willing to create a patch for this theme? I don't know how to, sorry!
Comment #4
roy6432 commentedI have the same problem with Drupal core 8.6.9 and Drupal8 Zymphonies Theme 8.x-1.4. (Notice: Undefined offset: 2 in drupal8_zymphonies_theme_preprocess_page () (line 109)
The problem also arises in other Zymphonies themes such as Business Responsive Theme 8.x-1.3 (Notice: Undefined offset: 2 in business_responsive_theme_preprocess_page () (line 123)
The problem is: $ variables ['current_path'] = $ current_path [2];
Does anyone know the solution?
The patch from comment # 2 does not work with me.
Comment #5
carnerik commentedI should clarify; when I said I "manually applied the patch," what I meant was that I opened the drupal8_zymphonies_theme/drupal8_zymphonies_theme.theme file and replaced line 109
$variables['current_path'] = $current_path[2];with
Which is what that patch did for the Sales Zymphonies theme, only with different line numbers.
@roy6432 Maybe try the same thing, if you haven't already?
Comment #6
roy6432 commentedThank you @carnerik for your help. Bug is gone.
Super
Comment #7
Annelies Van der Wee commentedThanks @carnerik!
I had also different bugs in my frontpage: bugs in the admin_menu and also with eu_cookie_compliance module, the popup didn't show up.
But now, with your help all bugs are gone! Great!!!
Comment #8
Raman Starshykh commentedComment #9
linichalexey commentedComment #10
karimb commentedHere is the patch. Hope this help.
Comment #11
karimb commentedComment #12
stacypendell commentedPatch works for me.
Comment #13
MatthijsG commentedFor some reason, the patch works but the error in the log persists :-/
Comment #14
kevin morse commentedPatch works for me as well.
Comment #15
kevin morse commentedThis is a very straightforward fix. I think it is RTBC
Comment #18
zymphonies-dev commentedComment #20
zymphonies-dev commented