Skip Navigation

[Resolved] Infinite scroll not working correctly, error 404 in console

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View that uses infinite scrolling, but it doesn't load more results.

Solution: Uncheck the checkbox "Disable the wrapping DIV around the View" for pagination effects.

This support ticket is created 5 years, 10 months 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 9 replies, has 3 voices.

Last updated by Beda 5 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1196719

I have the same problem, I do this, and finally the errors in console are:
"A bad HTTP response code (404) was received when fetching the script."
"Failed to load resource: net::ERR_INVALID_RESPONSE"

#1196724

Thanks for the report. I remember seeing an issue where Cloudflare HTML minification was used on the server environment, and it broke Infinite Scrolling: https://toolset.com/forums/topic/infinite-scroll-replaces-first-10-posts-but-thereafter-works-properly/
May I ask if your site is on Cloudflare?

If not, please follow the troubleshooting steps I outlined in the other ticket:
- Temporarily deactivate all plugins except Types and Views, then activate a default theme like Twenty Nineteen
- Test again. If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the same browser console error appears after deactivating your theme and other plugins, let's try to get more information about the error by activating server logs. Go in your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Reload the View on the front-end of the site and try to use the infinite scrolling feature again. If any server-side errors are generated, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.

#1196736

The error that appears in error_log.txt is this:
[06-Feb-2019 14:23:08 UTC] PHP Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /usr/home/enaranda/www/wp-includes/functions.php on line 3813

It appears repeatedly many times

#1196914

I see lots of reports about this online, and they're all related to the zlib output compression module installed on the server. Do you have a phpinfo page available? Can you see if zlib compression is active? If you're not familiar with phpinfo, there's a description available here: https://toolset.com/toolset-requirements/
Basically you will create a text file and upload it to your server, then visit that URL to see different information about the PHP modules that are running. Search for

zlib.output_compression

. If it's on, see if your host will turn it off. If it's off, see if your host will turn it on. Let me know what you find out.

#1197198

Hello,
I set zlib.output_compression = Off into .php.ini file, and error "PHP Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in ..." has disappeared.
Now, I've tried to deactivate all plugins (except types and views) and activate Twenty Nineteen 1.2 theme, but error

"A bad HTTP response code (404) was received when fetching the script."
"Failed to load resource: net::ERR_INVALID_RESPONSE"

appears in console again, and infinite scroll doesn't work.

#1197449

May I log in to your wp-admin area to take a look? I will activate private reply fields here.

#1198208

It's very strange, but somehow the data for the Search and Pagination section had become corrupted. It looked okay in wp-admin, but somehow in the database it was not set correctly. I added a line break to the filters editor to trigger an update. Then I resaved the View, and it appears to be working as expected now. Can you confirm?

#1198389

Yes, it works correctly now. I think that solution is unmark "Disable the wrapping DIV around the View" option in view.
This was the problem. Thank you for your help.

#1198390

My issue is resolved now. Thank you!

#1376233

There is a fatal error mentioned here in the ticket for which this erratum might be a resolution:
https://toolset.com/errata/unknown-fatal-error-when-activating-toolset-access/