Problem/Motivation

When looking at the view for the first time or after clearing the cache I see the following error:

Warning: implode(): Invalid arguments passed in Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::buildRouteIdentifier() (line 168 of modules/contrib/views_menu_children_filter/src/Plugin/views/argument/MenuChildren.php).
Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::buildRouteIdentifier('main', 'view.support.page_1', Array) (Line: 130)
Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::getMenuLinkFromTargetUrl(Array, Object) (Line: 87)
Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren::filterChildrenNodeByParent(Object, 'support', Array) (Line: 74)
Drupal\views_menu_children_filter\Plugin\views\argument\MenuChildren->query() (Line: 1099)
Drupal\views\ViewExecutable->_buildArguments() (Line: 1253)
Drupal\views\ViewExecutable->build() (Line: 390)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 168)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1616)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
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: 574)
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: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This appears to be because $route_parameters can be empty.

Proposed resolution

Check the variable that is passed to implode() for empty-ness.

CommentFileSizeAuthor
#2 warning_implode_-2897796-2.patch1014 bytesJohn Cook
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Cook created an issue. See original summary.

John Cook’s picture

Status: Active » Needs review
FileSize
1014 bytes

I've added the check in buildRouteIdentifier().

  • cravecode committed fcf6784 on 8.x-1.x authored by John Cook
    Issue #2897796 by John Cook: "Warning: implode(): Invalid arguments"...
cravecode’s picture

Thanks for the patch @John. I'll be honest, I haven't tested it. The patch looks innocent enough to me, so I committed it.

John Cook’s picture

Status: Needs review » Fixed

I'm assuming it's fixed ;)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.