-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recoverable fatal error: jetpack/modules/infinite-scroll/infinity.php on line 1763 #17461
Comments
|
Thanks for the report. Could you let me know what theme you experienced this with? |
Theme based on https://github.com/automattic/_s /**
* Add theme support for infinite scroll.
*
* @link https://jetpack.com/support/infinite-scroll/
*/
add_theme_support( 'infinite-scroll', array(
'type' => 'click',
'wrapper' => false,
'render' => function () {
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', 'blog' );
}
},
) ); |
Is your theme available for download, so I can give it a quick test? Thanks! |
It isn't available but it doesn't have a big differences with |
I've tried reproducing with a new theme built off Do you have any additional Infinite Scroll customizations in place, using filters such as |
@jeherve: The problem here is a combination of two things.
As for what we might do here, I see two options.
I see the AMP code was added in #16048 by @pereirinha, maybe they can provide further insight here. |
I just came across this myself. To me this seems like a strange way to implement extensibility. Shouldn't there rather be an action like: do_action( 'jetpack_initialize_infinite_scroll' ); Then instead of the theme compatibility doing this: jetpack/modules/theme-tools/compat/twentytwenty.php Lines 164 to 174 in c663b90
It could instead do: add_action( 'jetpack_initialize_infinite_scroll', function() {
add_filter( 'jetpack_amp_infinite_footers', 'twentynineteen_amp_infinite_footers', 10, 2 );
add_filter( 'jetpack_amp_infinite_output', 'twentynineteen_amp_infinite_output' );
add_filter( 'jetpack_amp_infinite_older_posts', 'twentynineteen_amp_infinite_older_posts' );
} ); Or rather, why not just: add_filter( 'jetpack_amp_infinite_footers', 'twentynineteen_amp_infinite_footers', 10, 2 );
add_filter( 'jetpack_amp_infinite_output', 'twentynineteen_amp_infinite_output' );
add_filter( 'jetpack_amp_infinite_older_posts', 'twentynineteen_amp_infinite_older_posts' ); Why the indirection? |
Thanks all for the inputs on this. I'll update this issue as soon as possible. |
I also have started a PR with what I believe is an improved approach to implementing infinite scroll in AMP: #17497. |
Steps to reproduce the issue
Infinite Scroll
->Load more posts as the reader scrolls down
What I expected
No error
What happened instead
Jetpack: 9.0.2
AMP: 2.0.4
The text was updated successfully, but these errors were encountered: