Skip Navigation

[Résolu] AJAX pagination in views causes JS errors

This support ticket is created Il y a 2 années et 2 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 réponses, has 3 voix.

Last updated by zeljko-turkaljS Il y a 2 années et 2 mois.

Assisted by: Shane.

Auteur
Publications
#2296505

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 hidden link

Thank you in advance for any idea how to fix this issue.

Best regards,
Petar

#2296699

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

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.

#2297477

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 (hidden 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 :/

#2298989

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

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

#2299095

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: hidden link

Further, we have even deleted the Toolset plugin and installed it again, no change.

Regards,
Petar

#2299227

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

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

#2300357

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

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

#2300827

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

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.