[Resolved] Paging broken – raising js errors after Views upgrade
This support ticket is created 5 years, 1 month ago. 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.
Hi,
We have a highly modified Toolset site. We upgraded recently to the latest versions of Toolset Views 2.9.2, and we just noticed that paging is broken on our main search view.
We use views paging, but we dequeue the front-end pagination scripts as we don't need the ajax functionality etc
This all worked fine, but I see a function in the wpv.class.php introduced in 2.8.5 enqueue_optional_frontend_assets - this appears to be doing a late enqueue of the pagination script which is effectively overriding our earlier dequeue action.
Is there a better way I can remove the views-pagination-script? If I need to dequeue it, then could you recommend a hook that I could use after enqueue_optional_frontend_assets is run?
If you check my script again Minesh, you'll see it is using the biggest integer available for priority so it will be executed last. I've tested with both wp_print_scripts and wp_enqueue_scripts and neither work.
Could you ask one of the developers? - and perhaps you could test it yourself before sending me something else to try? - it's easy to check that the script is dequeued.
Can you please share full screenshot of your view's edit page as well as how exaxtly where you added the view? Is the view is added using blocks editor or you added the view using view's shortcode?
Once you share this information I will start my further debug and test this further.
/**
* Enqueue the frontend scripts, only when a View has been printed.
*
* @since 2.8.5
*/
public function enqueue_optional_frontend_assets() {
// Pagination
// Note that both jquery-ui-datepicker-local and views-pagination-script have jquery-ui-datepicker as dependency
// Note that since WP 4.6.0 we do not register this locale script anymore
if ( wp_script_is( 'jquery-ui-datepicker-local', 'registered' ) ) {
wp_enqueue_script( 'jquery-ui-datepicker-local' );
}
if ( ! wp_script_is( 'views-pagination-script' ) ) {
wp_enqueue_script( 'views-pagination-script' );
}
}
This is the new enqueue code added to the Views plugin in V2.8.5 - I need to dequeue the 'views-pagination-script' - it really is that easy. Could you please pass this to someone who might be able to help me.