Hello,

when I use the fulltext field, in logs I get this error:

InvalidArgumentException : Source path https://mysite.com/page?search_api_fulltext=myword has to start with a slash. in Drupal\Core\Path\AliasManager->getAliasByPath() (line 186 de /srv/data/web/vhosts/myserver.com/htdocs/core/lib/Drupal/Core/Path/AliasManager.php).

Have you seen this error with a fulltext search?

thanks.

Comments

kumkum29 created an issue. See original summary.

drunken monkey’s picture

Status: Active » Postponed (maintainer needs more info)

How do you have your search page set up?
And could you get the stack trace for that exception?

kumkum29’s picture

Hi drunken monkey,

sorry for the delay...

I get this error for all the searches in a fulltext search field.
The search page is built with view, and the fulltext search field is exposed in a block (exposed filters settings in the right column).
So, I'm displaying the block in a different region of the view.

In the logs, I see that the query is mentionned 2 times :

?search_api_fulltext=&search_api_fulltext_1=6471

The Ajax option is enabled on the view.

drunken monkey’s picture

Please try to get the stack trace for the error. It seems to be in a completely unrelated part of the site. So maybe something in the way the view is configured? (For instance, the view mode used?) It’s very hard to tell.
Is everything still working fine, as far as you can see? Is it just the error in the logs?

For getting the stack trace, try going to admin/config/development/logging and setting “ Error messages to display” to “All messages, with backtrace information”. Then, after triggering the error, it should be displayed on the page (maybe after refreshing the tab, if it’s just via an AJAX request), too.

Does it happen, too, if you deactivate AJAX?

oligerd’s picture

Hi drunken monkey!
I also get this error when submit a fulltext search on a page with facets and a search field displayed in a block. The error appears in Recently logs and in the Web console.

InvalidArgumentException: Source path http://d8-eztexting/resources?fulltext=text has to start with a slash. in Drupal\Core\Path\AliasManager->getAliasByPath() (line 229 of /home/www/d8-eztexting/web/core/lib/Drupal/Core/Path/AliasManager.php).

Drupal\switch_page_theme\Theme\PageThemeNegotiator->applies() (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme() (Line: 405)
Drupal\Core\Theme\ThemeManager->initTheme() (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 75)
Drupal\Core\Render\ElementInfoManager->getInfo() (Line: 814)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1238)
Drupal\views\ViewExecutable->build() (Line: 1391)
Drupal\views\ViewExecutable->execute() (Line: 167)
Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay->fillFacetsWithResults() (Line: 374)
Drupal\facets\FacetManager\DefaultFacetManager->updateResults() (Line: 184)
Drupal\facets\FacetManager\DefaultFacetManager->processFacets() (Line: 270)
Drupal\facets\FacetManager\DefaultFacetManager->build() (Line: 83)
Drupal\facets\Plugin\Block\FacetBlock->build() (Line: 204)
Drupal\facets_block\Plugin\Block\FacetsBlock->buildFacets() (Line: 247)
Drupal\facets_block\Plugin\Block\FacetsBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender()
call_user_func_array() (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 781)
Drupal\Core\Render\Renderer->doCallback() (Line: 372)
Drupal\Core\Render\Renderer->doRender() (Line: 200)
Drupal\Core\Render\Renderer->render() (Line: 156)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 157)
Drupal\Core\Render\Renderer->renderPlain() (Line: 151)
Drupal\facets\Controller\FacetBlockAjaxController->ajaxFacetBlockView()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 49)
Drupal\custom_response_filter\StackMiddleware\CustomRemoveHttpHeadersMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

	
drunken monkey’s picture

Project: Search API » Switch Page Theme
Version: 8.x-1.14 » 8.x-3.x-dev
Component: General code » Code
Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Active

Based on the stack trace, this was triggered by the “Switch Page Theme” module. I don’t know that module, but maybe they assume something about the RouteMatch object that isn’t necessarily the case? Anyways, I’d start the investigation there.

Another possibility is that the Facets module triggers the view execution in a way that causes problems in some scenarios. Seems even though only the view’s results are needed, an exposed form is constructed and it’s exactly that part that triggers the error. If Facets could avoid construction of the exposed form in some way, it would both prevent this error and save performance. (No idea whether that’s easily/cleanly possible, though.)