When I enable AJAX pagination on views I get this error in browser console:
jquery.min.js?ver=3.6.0:2 Uncaught TypeError: Cannot read properties of undefined (reading 'sort')
at a.ViewSorting.t.get_sort_data (views-frontend.js?ver=3.6.2:1:11442)
at a.ViewFrontendUtils.t.get_updated_query_results (views-frontend.js?ver=3.6.2:1:9000)
at a.ViewPagination.t.pagination_preload_next_page (views-frontend.js?ver=3.6.2:1:33718)
at a.ViewPagination.t.pagination_preload_pages (views-frontend.js?ver=3.6.2:1:32950)
at HTMLDivElement.<anonymous> (views-frontend.js?ver=3.6.2:1:63062)
at Function.each (jquery.min.js?ver=3.6.0:2:3003)
at s.fn.init.each (jquery.min.js?ver=3.6.0:2:1481)
at a.ViewPagination.t.init_preload_pages (views-frontend.js?ver=3.6.2:1:62928)
at a.ViewPagination.t.init (views-frontend.js?ver=3.6.2:1:63503)
at new a.ViewPagination (views-frontend.js?ver=3.6.2:1:63561)
I am providing Toolset Debug info, so I believe everything relevant can be seen from there... Site is in 'coming soon' mode, you can bypass it using URL versteckter Link
Thank you in advance for any idea how to fix this issue.
Best regards,
Petar
Hi Petar
There is nothing that jumps out from your debug info as problematic.
When I visit your URL I see a JS error, though it is actually different than the one you shared.
Before going any further, can we please eliminate possible conflicts.
Disable all plugins except Toolset, and make sure you are not running any custom code (if you edited the theme's functions.php file, switch theme to twentytwenty, and disable any code snippets added in Toolset > Settings). Then check the page on the front end again. If there are no more errors then you should be able to determine the source of any conflict that triggers the problem by a process of elimination.
Let us know what you find.
Hi Nigel,
we have no custom code in Toolset Settings and haven't modified theme's functions.php. The method you suggested (disabling plugins) might be kind of problematic, because the site is "nearly" in production.
I forgot to mention that we got all that working without errors on our development envorinment (versteckter Link). The whole site has been copied on the new environment.
Obviosly something is different in the production environment, but I didn't find out what :/
Hi Petar,
Unfortunately we would need for you to disable the plugins as it could be that another plugin may not be compatible with your server configuration and throwing the errors.
Given the site is in coming soon mode then you should be able to perform these steps.
Thanks,
Shane
Hi Shane,
we have disabled all the plugins except Toolset Types and Toolset Views and changed the theme to twenty twenty-one. Unfortunately, the error remains.
Please take a look at the captured video: versteckter Link
Further, we have even deleted the Toolset plugin and installed it again, no change.
Regards,
Petar
Hi Petar,
Thank you for the information.
Would you mind providing me with admin access to the site so that I can create a copy to test here locally?
Please let me know.
Thanks,
Shane
Hi Petar,
The view that is causing the issue is "Partneri pocetna"
I've found that for your other view if I add the pagination to that view it doesn't generate any JS error in the console. Can you remake the "Partneri pocetna" view and try again and let me know if the error still appears.
Thanks,
Shane
Hi Shane,
I have created a new view with exactly the same settings as the problematic one, and this one does not throw any errors. Very strange, but the problem is solved.
Many thanks for your help!
Regards,
Petar