GET error for ridiculous pagination
-
The loader was failing, generating a console error, trying to get the posts for a ridiculously high numbered pagination. Odd, considering this code had worked fine on an identiacal site setup, but different host.
Diving into the code and using the GITHUB repository for the files, I found an odd section in the byscripts_ajax_posts_loader.php file:
'page_link_model' => get_pagenum_link(9999999999),
I couldn’t work out what this was doing, until I looked into the byscripts_ajax_posts_loader.js file and found this:
var next_link = page_link_model.replace(/9999999999/, page_number_next);
This direct string replace was failing because, for some reason, the get_pagenum_link(9999999999) call was not returning ‘9999999999’ but some other number.
In GITHUB, the code is different and seems to be doing a regexp replacement rather than an exact string replacement, so it’s possible more recent versions are using the more versatile REGEXP replacement.
Solution: Make sure you have the uptodate version of the plugin, but if you have had to modify the files for whatever reasons, then you will need to make the get_pagenum_link numbers match!
- The topic ‘GET error for ridiculous pagination’ is closed to new replies.