Open evs-xsarus opened 3 months ago
@evs-xsarus Which theme are you using? Because both luma and hyva theme seem to prevent searching of empty strings, and only start searching if you've typed 3 characters. I can't reproduce the issue there.
So i think this may be an issue in the theme you are using.
This is a custom theme and it can thus occur there is no query. Is it possible to start a request to Tweakwise only if there is a value in tn_q ? Or prevent the Tweakwise part breaking on an empty tn_q ?
@evs-xsarus I'll check. If it's easy to implement we will add an check on an empty q value
@ah-net did you manage to add the check on an empty q value?
@evs-xsarus Not yet, this ticket is added to our backlog. But due to other priorities this hasn't been done yet. It is not known when we will look into this issue.
@evs-xsarus Wat is the exact ajax url that causes this issue? Because I can't reproduce it. If I call the ajax url without an q value, it redirects and TW is never called. /search/ajax/suggest/?q=
Hi, You can reproduce it on:
https://www.dille-kamille.nl/eten-drinken/drinken/thee/
In the searchbar, enter a few spaces and then a character, e.g. d
seems to triiger this. The call goes to Magento and then to Tweakwise
https://gateway.tweakwisenavigator.net/suggestions/090bb431?tn_q=&tn_cid=100012
Call to Magento: https://www.dille-kamille.nl/search/ajax/suggest/cid/43/?q=%20%20&_=1719498299076
@evs-xsarus Thx. The spaces seem to trigger the error. I'll see if i can find an solution for this.
Issue Brief
What is the purpose of this issue? Explain the background context.
Environment
Steps to reproduce
Start searching for suggestions, if this happens too soon, there is no search term. The request will be :
Actual result
This will then return a GuzzleHttp\Exception\ClientException: Client error: 400 Bad request
Stack trace:
Expected result
The request will not happen and the calling function will return an empty result.