- Issue created by @baikho
- Merge request !11906Issue #3520385: Route not found error when creating new search pages โ (Open) created by baikho
- ๐ณ๐ฟNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies โ .
- ๐ฎ๐ณIndia prashant.c Dharamshala
prashant.c โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia prashant.c Dharamshala
Great find. Was able to replicate easily on
11.x
as well and got the following error, while creating any type of search page (node, user and help):The website encountered an unexpected error. Try again later. Symfony\Component\Routing\Exception\RouteNotFoundException: Route "search.view_content" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 214 of core/lib/Drupal/Core/Routing/RouteProvider.php). Drupal\Core\Routing\UrlGenerator->getRoute() (Line: 290) Drupal\Core\Routing\UrlGenerator->generateFromRoute() (Line: 105) Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute() (Line: 773) Drupal\Core\Url->toString() (Line: 176) Drupal\Core\Utility\LinkGenerator->generate() (Line: 104) Drupal\Core\Render\Element\Link::preRenderLink() call_user_func_array() (Line: 107) Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 848) Drupal\Core\Render\Renderer->doCallback() (Line: 393) Drupal\Core\Render\Renderer->doRender() (Line: 203) Drupal\Core\Render\Renderer->render() (Line: 491) Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 184) __TwigTemplate_cb3fcbd5c3a204683387ed7f057a01d2->doDisplay() (Line: 388) Twig\Template->yield() (Line: 344) Twig\Template->display() (Line: 359) Twig\Template->render() (Line: 51) Twig\TemplateWrapper->render() (Line: 34) twig_render_template() (Line: 369) Drupal\Core\Theme\ThemeManager->render() (Line: 452) Drupal\Core\Render\Renderer->doRender() (Line: 465) Drupal\Core\Render\Renderer->doRender() (Line: 465) Drupal\Core\Render\Renderer->doRender() (Line: 203) Drupal\Core\Render\Renderer->render() (Line: 242) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 599) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 235) Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 131) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246) Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206) Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56) Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 188) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 715) Drupal\Core\DrupalKernel->handle() (Line: 19)
- ๐ฎ๐ณIndia prashant.c Dharamshala
- Created a branch for 11.x, MR 3520385-route-not-found-11.x
- Added changes in the
core/modules/search/src/Form/SearchPageFormBase.php
instead of thecore/modules/search/src/Form/SearchPageAddForm.php
- Used the https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Routing%2...
Needs a review, and then the changes could be backported.
- ๐ฎ๐ณIndia prashant.c Dharamshala
prashant.c โ changed the visibility of the branch 10.4.x to hidden.
- ๐ฎ๐ณIndia sdhruvi5142
Hi,
Applied and verfied MR!11911 on drupal 11.x version and it is working as expected. Error has been removed.Testing Steps:
1. Install and did set up for drupal 11.x
2. Go to /admin/config/search/pages
3. Click "Add search page"
4, Select any search type (e.g., "Content")
5. Fill in the form and save
6. Observe the error: "Route 'search.view_[machine_name]' does not exist"Testing Result:
Before applying patch I was able to see the error (added ss for reference) and after applying the patch following the above steps error isn't being displayed and it is working as expected.
Added screenshots for reference. So moving this to RTBC+1Status: PASS
- ๐ฎ๐ณIndia prashant.c Dharamshala
Thanks @sdhruvi5142 for testing the changes, code review also needed for this, changing to NR.
- ๐บ๐ธUnited States smustgrave
Small comment on MR but probably needs test coverage too.
- ๐ฎ๐ณIndia prashant.c Dharamshala
Added functional test coverage https://git.drupalcode.org/project/drupal/-/merge_requests/11911/diffs#4...