• Resolved jonroc804

    (@jonroc804)


    When I call the wp_trash_post() function a fatal error is created by MemberPress plugin. 6.9.2 is the last working version.

    PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function gamipress_delete_post_listener(), 1 passed in /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-includes/class-wp-hook.php on line 308 and exactly 2 expected in /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-content/plugins/gamipress/includes/listeners.php:131\nStack trace:\n#0 /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-includes/class-wp-hook.php(308): gamipress_delete_post_listener()\n#1 /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#2 /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()\n#3 /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-includes/post.php(3608): do_action()\n#4 /home/723525.cloudwaysapps.com/dgxubaqzsz/public_html/wp-content/themes/review_books_child/inc/custom-account.php(221): wp_trash_post()\n#5 /home/723525.cloudwaysapps.com/dgxubaqzsz...', referer: https://getbooksreviewed.com/account/reader/
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @jonroc804

    Are you calling the gamipress_delete_post_listener() function from custom code? The hook used by GamiPress was recently updated as it receives 2 arguments as you can see in the official WordPress documentation: https://developer.www.ads-software.com/reference/hooks/trashed_post/

    Thread Starter jonroc804

    (@jonroc804)

    @dioni00 I’m not calling that function. The function is breaking when I call the standard wp_trash_post() function. This can only receive one argument.

    • This reply was modified 11 months, 2 weeks ago by jonroc804.
    • This reply was modified 11 months, 2 weeks ago by jonroc804.
    Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @jonroc804

    I have performed a test using the wp_trash_post function and created a GamiPress event where I am awarded earnings when deleting a post through the wp_trash_post() function. I have not been able to replicate the error, please, if you are using custom code, check if an additional call is being made to the trashed_post hook that could be causing that error.

    Thread Starter jonroc804

    (@jonroc804)

    @dioni00 I am not calling trashed_post?anywhere in the project but wp_trash_post() does call it on line 3721 so the issue is probably there. My specific setup is after a form is submitted then wp_trash_post() is called to delete a post.

    Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @jonroc804

    Please update to the latest version of GamiPress, after checking our versions, the change to check post deletion was introduced in version 6.9.5.

    The trashed_post hook is launched as you have seen in line 3721 where it collects the two arguments. The error may be due to the outdated version of GamiPress

    Thread Starter jonroc804

    (@jonroc804)

    @dioni00 yes any version past 6.9.5 is what causes the fatal error.

    Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @jonroc804

    Please, open a support ticket here: https://gamipress.com/contact-us/ and, please, add the debug.log generated by WordPress so we can see more details about the error. I’ve tested again with the GamiPress delete posts event by calling the wp_trash_post function and I can’t replicate the error.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal Trash Bug Introduced in 6.9.3’ is closed to new replies.