Issue link generated with views ajax

Created on 23 March 2020, over 4 years ago
Updated 28 February 2024, 9 months ago

Hi,

I need to use ajax in my exposed form with search api view.
I implement a Did You Mean SpellCheck in the header of my view.
My view is a block in my page.
I use the module better_filter_exposed too but it doesn't seem to be the issue.

It is displayed and works correctly in terms of suggestions but the link generated is not good :

<div class="sapi-did-you-mean">
  <span class="did-you-mean-prefix">Vouliez-vous dire : </span>
  <a href="/views/ajax?search_api_fulltext=categorie&amp;dates%5Bmin%5D=&amp;dates%5Bmax%5D=">categorie</a>
  <span class="did-you-mean-suffix">?</span>
</div>

The link returned by the method getSuggestionLink use , is the ajax views route in this case ( views.ajax ) .
On click in my use case it launch the ajax url on the browser, not an ajax call, an error occured for the user.

I suggest to edit the method getSuggestionLink to get the correct in context of ajax call (via http referer) and reload the page.

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom 3li U.K. 🇬🇧

    Found the same issue still exists on 4.0.0
    re-rolled the same patch with some changes to help it apply.

  • Status changed to Needs work 9 months ago
  • 🇵🇱Poland lamp5 Rzeszow

    It does not work for multisite drupal sites.

    Symfony\Component\Routing\Exception\RouteNotFoundException: Route "/doamin3/search" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).
    Drupal\Core\Routing\UrlGenerator->getRoute() (Line: 276)
  • 🇵🇱Poland lamp5 Rzeszow

    I suggest to close this issue (duplicated) and check this issue 🐛 URL don't include the base path Needs work

Production build 0.71.5 2024