Using Drupal v8.4.2 and latest MDSlider. All caching is disabled. twig debugging is on
Installed slider per documentation, added a field for the slider to Basic Page via: Home-> Administration-> Structure-> Content types-> Basic page.
Field: MDSlider
Machine name: field_mdslider.
Field is set to be hidden.
I then created a new slider and added it to our home page: /node/1 using the 'MDSlider' pulldown selection to select the new slider I created. The slider looks and works great when we view the home page.
The problem occurs when I add another basic page that will not use the slider. If the MDSlider pulldown selection is set to be: 'None' the following errors are generated on the page when it is viewed.
-
User error: "0" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).
Drupal\Core\Render\Element::children(Array) (Line: 84)Drupal\Core\Field\FormatterBase->view(Object, 'en') (Line: 259)Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 320)Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24)Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 263)Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 220)Drupal\Core\Entity\EntityViewBuilder->build(Array)call_user_func(Array, Array) (Line: 378)Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 576)Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 108)Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 158)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: 50)Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
-
User error: "0" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).
Drupal\Core\Render\Element::children(Array, 1) (Line: 408)Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)Drupal\Core\Render\Renderer->render(Array) (Line: 490)Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 114)__TwigTemplate_4ae59022820823361d314fdb0db03eda142ac3295eb1399a7323e963e3d3bf5a->doDisplay(Array, Array) (Line: 432)Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)Twig_Template->display(Array) (Line: 411)Twig_Template->render(Array) (Line: 64)twig_render_template('core/themes/bartik/templates/node.html.twig', Array) (Line: 384)Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 437)Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 576)Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 108)Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 158)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: 50)Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Hi,
We test on Drupal 8.4.2 and see no error as you reported
However, please try the version that we send you via email
please check your email
Thank you for the quick response.
The updated version you sent has resolved the problem.