Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress causing fatal error on site when forum subscribed or email notifications


  • beachcalsix
    Participant

    @beachcalsix

    Hi, I’m hoping someone can help me as my host directed me to contact the plugin directly. Any interaction made on my site with the bbpress forum will result in a critical error. I’m not sure what is causing the conflict. I have the bbpress private groups plugin installed as well.

    Error Details
    =============
    An error of type E_ERROR was caused in line 62 of the file. Error message: Uncaught ArgumentCountError: Too few arguments to function bbp_format_buddypress_notifications(), 5

    Has this happened to anyone else? Is there any way to fix it? I think it happens whenever someone tries to click “subscribe” or “notify me of follow-up replies via email”

    Thanks in advance for any input you can give!

Viewing 9 replies - 1 through 9 (of 9 total)

  • Robin W
    Moderator

    @robin-w

    the error message is usually longer, if you have more can you post the full error


    beachcalsix
    Participant

    @beachcalsix

    Sorry, I thought the rest was just additional info. Here is the full error from the email I received:

    Site info
    WordPress version 5.9.3
    Current theme: Olympus child Theme (version 1)
    Current plugin: bbPress (version 2.6.9)
    PHP version 8.0.17

    Error Details
    =============
    An error of type E_ERROR was caused in line 62 of the file /home/advance1/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/notifications.php. Error message: Uncaught ArgumentCountError: Too few arguments to function bbp_format_buddypress_notifications(), 5 passed in /home/advance1/public_html/wp-includes/class-wp-hook.php on line 307 and exactly 8 expected in /home/advance1/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/notifications.php:62
    Stack trace:
    #0 /home/advance1/public_html/wp-includes/class-wp-hook.php(307): bbp_format_buddypress_notifications()
    #1 /home/advance1/public_html/wp-includes/plugin.php(233): WP_Hook->apply_filters()
    #2 /home/advance1/public_html/wp-content/plugins/youzify/includes/premium/public/core/functions/youzify-live-notifications-functions.php(83): apply_filters_ref_array()
    #3 /home/advance1/public_html/wp-content/plugins/youzify/includes/premium/public/core/functions/youzify-live-notifications-functions.php(27): youzify_get_the_notification_description()
    #4 /home/advance1/public_html/wp-includes/class-wp-hook.php(307): youzify_process_notification_request()
    #5 /home/advance1/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters()
    #6 /home/advance1/public_html/wp-admin/includes/ajax-actions.php(3425): apply_filters()
    #7 /home/advance1/public_html/wp-includes/class-wp-hook.php(307): wp_ajax_heartbeat()
    #8 /home/advance1/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #9 /home/advance1/public_html/wp-includes/plugin.php(474): WP_Hook->do_action()
    #10 /home/advance1/public_html/wp-admin/admin-ajax.php(187): do_action()
    #11 {main}
    thrown

    It mentions buddypress and youzify. I have both plugins if that helps.
    Thanks so much for the quick response!


    Robin W
    Moderator

    @robin-w

    it looks like youzify from that error log (but cannot guarantee).

    I’d suggest you try deactivating youzify as a test and see if the error diappears.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    beachcalsix
    Participant

    @beachcalsix

    Thanks for the help! I will do some testing today.
    Thanks again!


    beachcalsix
    Participant

    @beachcalsix

    Further info update:

    Hi, after doing further testing, I’m still getting an error. I deactivated youzify. Then, I deactivated bbpress and buddypress but still getting an error. I am not too familiar with the files and coding but I opened the files where the errors are indicatd in the above error message I posted. If anyone is familiar and sees an error, I would really appreciate the heads up. Probably a long shot but thought I’d try. Thanks!

    First file:
    An error of type E_ERROR was caused in line 62 of the file /home/advance1/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/notifications.php. Error message: Uncaught ArgumentCountError: Too few arguments to function bbp_format_buddypress_notifications(), 5

    this is the code showing in the above file currently:

    Line 62-6 :

    function bbp_format_buddypress_notifications( $content, $item_id, $secondary_item_id, $action_item_count, $format, $component_action_name, $component_name, $id ) {

    // Bail if not the notification action we are looking for
    if ( 0 !== strpos( $component_action_name, ‘bbp_new_reply’ ) ) {
    return $content;
    }

    _______________
    The code found in this file: passed in /home/advance1/public_html/wp-includes/class-wp-hook.php on line 307:

    line 303: // Avoid the array_slice() if possible.
    if ( 0 == $the_[‘accepted_args’] ) {
    $value = call_user_func( $the_[‘function’] );
    } elseif ( $the_[‘accepted_args’] >= $num_args ) {
    line 307–> $value = call_user_func_array( $the_[‘function’], $args );
    } else {
    $value = call_user_func_array( $the_[‘function’], array_slice( $args, 0, (int) $the_[‘accepted_args’] ) );
    }
    }
    } while ( false !== next( $this->iterations[ $nesting_level ] ) );

    ________________
    Last error file:passed in /home/advance1/public_html/wp-includes/class-wp-hook.php on line 307


    Robin W
    Moderator

    @robin-w

    If you have deactivated bbpress, then the error cannot show as this is a bbpress function, where are you seeing these errors – if in a log, then are you sure the log is being cleared before each test


    beachcalsix
    Participant

    @beachcalsix

    Hi, the error codes were found in my files in the back end/ftp. The error email is only sent to me while bbpress is activated. It has been hard to find out what is causing this. I tried deactivating youzify as well as buddypress. So far no more error emails have been received but I’m at a loss as to where it’s coming from exactly and how to correct it. My site needs these 3 plugins to function as well as the bbpress private groups plugin I have. My only theory is that the privacy function is conflicting with the notifications for some reason but like I said, it’s hard to pinpoint. My host is unsure and said to try asking bbpress. Maybe someone has a similar issue? I’ll keep researching and if I find an answer, I’ll post it here.


    Robin W
    Moderator

    @robin-w

    something (not bbpress) is using a filter to call this function.

    so you’d be looking for a hook that looks kinda like this

    add_filter( ‘bp_notifications_get_notifications_for_user’, ‘xxxxxxxx’, 10, 5 );

    or some code directly calling ‘bp_notifications_get_notifications_for_user’

    Both of those should pass 8 arguments, but are only passing 5 – hence the issue.

    it is not bbp-private-groups

    if you really want to track it down, then use FTP to transfer the wp-content directory of your site to your PC.

    then download and install notepad++ and use the search/find in files option to find bp_notifications_get_notifications_for_user in wp-content

    that should get you to options where it is called


    beachcalsix
    Participant

    @beachcalsix

    Wow thanks for the input, it’s a great help! I will try that out today and report back! Thanks again!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar