• Resolved Goce Mitevski

    (@gocemitevski)


    Akismet 4.1.3 causes a fatal error on PHP 7.4 on single.php.

    PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Akismet::set_form_js_async(), 1 passed in wp-includes/class-wp-hook.php on line 288 and exactly 3 expected in wp-content/plugins/akismet/class.akismet.php:1199
    Stack trace:
    #0 wp-includes/class-wp-hook.php(288): Akismet::set_form_js_async()
    #1 wp-includes/plugin.php(206): WP_Hook->apply_filters()
    #2 wp-content/themes/XXX/single.php(63): apply_filters()
    #3 wp-includes/template-loader.php(98)
    #4 wp-blog-header.php(19)
    #5 index.php(17)
    #6 {main}
      thrown in wp-content/plugins/akismet/class.akismet.php on line 1199
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Christopher Finke

    (@cfinke)

    Hi Goce,

    I’m unable to reproduce with the latest WordPress release, Akismet 4.1.3, and PHP 7.4.

    The next step in debugging is to see how your theme is calling apply_filters.
    Can you post the code from your theme around line 63?

    It’s also possibly that another plugin you’re running is modifying what gets passed to set_form_js_async(). You could confirm this by disabling your other plugins (and anything in mu-plugins) and seeing if the issue still exists. Let me know what you find out.

    Thread Starter Goce Mitevski

    (@gocemitevski)

    Thanks @cfinke!

    You’re right. The problem was caused by a call to apply_filters(), specifically to the ‘script_loader_tag’ filter. As soon as I removed the apply_filters() wrapper the error was gone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 7.4 Fatal Error: Too few arguments to function Akismet::set_form_js_async()’ is closed to new replies.