• Resolved gamerlevelup

    (@gamerlevelup)


    Hello, first of all thank you for the wonderful plugin from Otter!

    I have a problem paginating the otter post element. As soon as I go to page 2 (no matter what number of elements I have set in”Post”) I get this PHP error message:

    2024/01/26 10:58:45 [error] 11584#11584: *527 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - int in
    /var/www/wordpress/wp-content/plugins/otter-blocks/inc/render/class-posts-grid-block.php:345
    Stack trace: 0 /var/www/wordpress/wp-content/plugins/otter-blocks/inc/render/class-posts-grid-block.php(36): ThemeIsle\GutenbergBlocks\Render\Posts_Grid_Block->retrieve_post

    s() 1 /var/www/wordpress/wp-includes/class-wp-block.php(258): ThemeIsle\GutenbergBlocks\Render\Posts_Grid_Block->render() 2 /var/www/wordpress/wp-includes/class-wp-block.php(244): WP_Block->render() 3 /var/www/wordpress/wp-includes/class-wp-block.php(244): WP_Block->render() 4 /var/www/wordpress/wp-includes/class-wp-block.php(244): WP_Block->render() 5 /var/www/gwordpress/wp-includes/blocks.php(1484): WP_Block->render() 6 /var/www/wordpress/wp-includes/blocks.php(1522): render_block() 7 /var/www/wordpress/wp-includes/block-template.php(263): do_blocks() 8 /var/www/wordpress/wp-includes/template-ca" while reading response header from upstream, client: xxx, server: gamerlevelup.de, request: "GET /page/2

    HTTP/2.0", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "gamerlevelup.de", referrer: "https://gamerlevelup.de/"

    From page 3 onwards I no longer get a PHP error, but rather the 404 page in my WordPress.

    Test Seite 2: https://gamerlevelup.de/page/2

    Test Seite 3: https://gamerlevelup.de/page/3

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter gamerlevelup

    (@gamerlevelup)

    I found this out:

    The error you’ve provided only occurs on PHP 8 and it is because you’re trying to add a string to an integer. In previous versions the error message used to be “A non-numeric value encountered” which in some situations made the issue a lot clearer.

    In PHP v5.6 you would receive no error at all (and the code would work fine)

    In PHP v7 you would be informed with a WARNING that “A non-numerical value was encountered”

    In PHP v8 you are informed with a FATAL error that “Uncaught TypeError: Unsupported operand types: string + int”

    Plugin Support AndreeaR

    (@andreearadacina21)

    Hey @gamerlevelup,

    Thank you for sharing the details!

    I was not able to replicate this issue. Can you share the exact steps I should follow in order to obtain it?

    Best regards,

    Andreea

    Thread Starter gamerlevelup

    (@gamerlevelup)

    Hi Andreea,

    I have moved from PHP8.1 to PHP7.4. Then it worked, but I got this warning in the logs “A non-numerical value was encountered”

    Since PHP7 is EOL, I’m back on PHP8.1 and no longer do the paging with Otton but with the “query loop” and my own template.

    TL;DR it works with PHP7.4 – but I wouldn’t recommend it to anyone since all versions of PHP7 are EOL.
    Otter should upgrade all of its PHP code to PHP8.

    Plugin Contributor irinelenache

    (@irinelenache)

    Hello @gamerlevelup,

    Thank you for providing more context regarding the issue!

    Can you please share some screenshots with the settings used for the Posts block? We still weren’t able to replicate the issue on a PHP 8.1 environment.

    Best regards,

    Irinel

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Otter Post Pagination error’ is closed to new replies.