Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search function breaks after a no results query
This topic contains 6 replies, has 2 voices, and was last updated by Ernest Marcinko 3 weeks, 6 days ago.
- AuthorPosts
- January 8, 2023 at 11:44 pm #40811
Hey,
First off I love your plugin so far, it’s worked perfectly except for one issue. If a user makes a search on my website which returns no results, the search will just stop working and be stuck on the loading icon.
You can try it out yourself to see what I mean: if you visit https://easywithai.com and search for something completely random, after you get no results it only works again a page refresh.
Do you have any ideas how I could fix this? Sorry if this is outside of the support for the plugin, I’ve searched quite a bit and can’t seem to find anything that might fix this or give me a lead on what’s causing it! I’m not great at coding but I can use WordPress and Elementor quite well, and I know how to add functions and custom css, etc, if any of that might be able to fix it.
I’m using Ajax Search Pro with the Elementor posts widget and use infinite scroll for my pagination, this problem doesn’t happen if I change the pagination to “Next/previous” so it must be something to do with the infinite scroll I’m guessing. I’d really like to use infinite scroll on my site so if there is a fix it would be great. If not, I guess I will have to just change the pagination.
Thanks so much for your time and great plugin!
Kind regards,
JayJanuary 8, 2023 at 11:58 pm #40812Hi,
I think I have caught the error log using Chrome inspector:
Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML’)
at Object.fixElementorLoadMoreResults (asp-eb889fb7.js:211:94)
at asp-eb889fb7.js:44:269
at Array.forEach (<anonymous>)
at asp-eb889fb7.js:44:236
at Array.forEach (<anonymous>)
at a.applyFilters (asp-eb889fb7.js:44:214)
at q (asp-eb889fb7.js:176:252)
at asp-eb889fb7.js:180:406
at window.WPD.intervalUntilExecute (asp-eb889fb7.js:45:308)
at Object.liveLoad (asp-eb889fb7.js:180:374)
fixElementorLoadMoreResults @ asp-eb889fb7.js:211
(anonymous) @ asp-eb889fb7.js:44
(anonymous) @ asp-eb889fb7.js:44
a.applyFilters @ asp-eb889fb7.js:44
q @ asp-eb889fb7.js:176
(anonymous) @ asp-eb889fb7.js:180
window.WPD.intervalUntilExecute @ asp-eb889fb7.js:45
liveLoad @ asp-eb889fb7.js:180
search @ asp-eb889fb7.js:92
(anonymous) @ asp-eb889fb7.js:130
setTimeout (async)
(anonymous) @ asp-eb889fb7.js:130I hope this might give you some more info about the problem and possible fix.
Thank you!
January 9, 2023 at 1:40 pm #40820Hi,
Thank you for the details!
The issue seems to be the one you have copy/pasted here. The plugin tries to resolve the “load more results” feature from the elementor posts widget, but it fails at some point during an existence check code.
For now, you can very likely resolve this by turning off the elementor widget infinite loader to a pagination instead. It is generally recommended, it has a much better compatibility. The infinite loader is very hard to handle.I will debug through this issue on a local server, and will try to figure it out for the upcoming release.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 9, 2023 at 3:18 pm #40827Hi Ernest,
Thank you very much for your response! I think for now I will just change the infinite loading to pagination in that case, I have noticed it tends to complicate almost everything, haha. If you’re able to fix it in a future release that would be amazing, I tried for hours to find a fix but it does seem pretty difficult. No worries if you’re unable to fix it, I’ll also let you know if I manage to find any solutions.
Thanks for your time with this!
Kindest regards,
JayJanuary 9, 2023 at 3:27 pm #40828Okay 🙂 I will definitely look into this for the upcoming release.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 11, 2023 at 3:55 pm #40865Hey Ernest,
Thank you for pushing the update to the plugin! It appears to have fixed the issue 🙂 If I set a spinner/loading icon in elementor infinite scroll settings it causes it to break again, but as soon I disable the loading icon it’s all working. Definitely not a big deal anyway, functionality wise it works perfectly now!
Thanks so much for helping me with this issue.
Kind regards,
JayJanuary 11, 2023 at 3:58 pm #40866You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.