Navigation überspringen

[Gelöst] AJAX pagination in views causes JS errors

This support ticket is created vor 2 Jahren, 10 Monaten. 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.

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)

Dieses Thema enthält 7 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von zeljko-turkaljS vor 2 Jahren, 10 Monaten.

Assistiert von: Shane.

Author
Artikel
#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 versteckter Link

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

Best regards,
Petar

#2296699

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00: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 (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 :/

#2298989

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: 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: versteckter Link

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

Regards,
Petar

#2299227

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: 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

Sprachen: Englisch (English )

Zeitzone: 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