Steps i followed:

installed uikit with composer
created subtheme with drush
enabled subtheme
created a new content type
gives a site error

Error log:

Error 1:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("node") to generate a URL for route "entity.node.canonical". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of .........../web/core/lib/Drupal/Core/Routing/UrlGenerator.php).

Error 2:
Warning: Invalid argument supplied for foreach() in Drupal\Core\Theme\Registry->processExtension() (line 447 of ....../web/core/lib/Drupal/Core/Theme/Registry.php)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

btriest created an issue. See original summary.

Richard Buchanan’s picture

Status: Active » Postponed (maintainer needs more info)

I wasn't able to reproduce this error, even when using a UIkit sub-theme as the admin theme. Have you updated to the latest 8.x-3.x-dev package? The theme shouldn't cause an error like this since it doesn't mess with or call any node routes.

We don't have a composer package for the 8.x-3.x branch, what do you mean by you installed UIkit with composer?

tkcent’s picture

Looks like I am encountering the same error. If I disable the Uikit sub-theme and just use Uikit it works find. When I set the Uikit sub-theme as default is when it breaks.

Here is the error message I get.

The website encountered an unexpected error. Please try again later.

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("node") to generate a URL for route "entity.node.canonical". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.node.canonical', Object, Array) (Line: 131)
Drupal\Core\Routing\UrlGenerator->getPathFromRoute('entity.node.canonical', Array) (Line: 68)
Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute('entity.node.canonical', Array) (Line: 790)
Drupal\Core\Url->getInternalPath() (Line: 314)
uikit_preprocess_menu__navbar(Array, 'menu__navbar', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('menu__navbar', Array) (Line: 435)
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: 93)
__TwigTemplate_69f3c63a7b7a831d46fef351fd0735f55378c913667fd57b0f363d79ec1db94a->block_content(Array, Array) (Line: 186)
Twig_Template->displayBlock('content', Array, Array) (Line: 82)
__TwigTemplate_69f3c63a7b7a831d46fef351fd0735f55378c913667fd57b0f363d79ec1db94a->doDisplay(Array, Array) (Line: 379)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 347)
Twig_Template->display(Array) (Line: 358)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/uikit/templates/block/block--navbar--menu.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 448)
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: 70)
__TwigTemplate_0c365be36b84f8f6a368a3a061e613fecf177f832fa4650370f756ba4b482760->doDisplay(Array, Array) (Line: 379)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 347)
Twig_Template->display(Array) (Line: 358)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/uikit/templates/layout/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 435)
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: 84)
__TwigTemplate_d65796fdf6014fd47c9196322b6147eb15cc7fc078f1d1959ed059cd38b02a42->doDisplay(Array, Array) (Line: 379)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 347)
Twig_Template->display(Array) (Line: 358)
Twig_Template->render(Array) (Line: 64)
twig_render_template('core/themes/stable/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
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 site originally had an older version of Drupal and Uikit that have both been upgraded and I am not sure at which point it broke.

I tried to replicate with the newest version of all the modules (which includs Bricks, ECK and Webform as well as their dependencies). However I can't seem to recreate the error.

Richard Buchanan’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks tkcent, the error message you copied gives me more info to go on. Will look into this and let you know what I find.

Richard Buchanan’s picture

Status: Active » Needs review
FileSize
1.82 KB

Okay, try out this patch and let me know how things go.

tkcent’s picture

I didn't test extensively but the patch in #5 works for me when using the Uikit theme and my custom sub-theme.

Thanks!

btriest’s picture

Thanks for the quick reply. I will test the patch today as well with the subtheme and will let you know. (next time i will post the complete error log ;))

btriest’s picture

FileSize
10.29 KB
17.21 KB

Hello Richard,

I tested the change and now the subtheme works well with custom content types.

During the test i only saw that when a submenu item is created the main menu item (parent) dissapears and is put under the first menu item. To explain this better i added two files. One with the menu structure. The second with the output.

Richard Buchanan’s picture

Status: Needs review » Fixed

Thanks btriest, glad to see the patch worked for you. I'll commit that to the dev branch today.

There's still a little work needed on the navbar menus with dropdowns. You can create a new issue with the images you uploaded since it is unrelated to this. That way others can see there is already an issue filed. Should have the dropdowns fixed in a couple days.

  • Richard Buchanan committed 8e424e0 on 8.x-3.x
    Issue #2885737 by Richard Buchanan, btriest, tkcent: Custom content...
Richard Buchanan’s picture

No need to create a new issue for the navbar parent/child items, this has been fixed and committed to dev branch.

See ce725e5.

Status: Fixed » Closed (fixed)

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