Skip to:
Content
Pages
Categories
Search
Top
Bottom

Participant accessing forum archive results in error


  • amitkumarsingh
    Participant

    @amitkumarsingh

    When participant tries to access the forum archive page, they see the following error:
    Fatal error: Uncaught Error: Call to a member function get_users_for_object() on null in /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php:125 Stack trace: #0 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php(146): bbp_get_users_for_object(6065, '_bbp_moderator_...', 'post') #1 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/capabilities.php(107): bbp_is_object_of_user(6065, 255, '_bbp_moderator_...') #2 /nas/content/live/wsscholars/wp-includes/class-wp-hook.php(287): bbp_map_primary_meta_caps(Array, 'moderate', 255, Array) #3 /nas/content/live/wsscholars/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array) #4 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/core/sub-actions.php(523): apply_filters('bbp_map_meta_ca...', Array, 'moderate', 255, Array) #5 /nas/content/live/wsscholars/wp-includes/class-wp-hook.php(287): bbp_map_meta_caps(Array, 'moderate', 255, Array) #6 /nas/content/live/wsscholars/w in /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php on line 125 Fatal error: Uncaught Error: Call to a member function get_users_for_object() on null in /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php:125 Stack trace: #0 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php(146): bbp_get_users_for_object(6065, '_bbp_moderator_...', 'post') #1 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/capabilities.php(107): bbp_is_object_of_user(6065, 255, '_bbp_moderator_...') #2 /nas/content/live/wsscholars/wp-includes/class-wp-hook.php(287): bbp_map_primary_meta_caps(Array, 'moderate', 255, Array) #3 /nas/content/live/wsscholars/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array) #4 /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/core/sub-actions.php(523): apply_filters('bbp_map_meta_ca...', Array, 'moderate', 255, Array) #5 /nas/content/live/wsscholars/wp-includes/class-wp-hook.php(287): bbp_map_meta_caps(Array, 'moderate', 255, Array) #6 /nas/content/live/wsscholars/w in /nas/content/live/wsscholars/wp-content/plugins/bbpress/includes/users/engagements.php on line 125

    On debugging, I was able to narrow it down to bbp_user_engagements_interface( $rel_key, $rel_type ) returning NULL for participant in function bbp_get_users_for_object().

    Can anyone help me figure out why this is happening or how I can resolve it?

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

  • chrisverticalplus
    Participant

    @chrisverticalplus

    Hi,

    I am encountering this error. did you ever find the cause?


    Robin W
    Moderator

    @robin-w

    can you print the exact error you are having.

    The one above I remember as fixed


    chrisverticalplus
    Participant

    @chrisverticalplus

    The error we are getting is the same:

    PHP Fatal error: Uncaught Error: Call to a member function get_users_for_object() on null in /var/www/vhosts/redacted-site-name/httpdocs/wp-content/plugins/bbpress/includes/users/engagements.php:125

    It seems bbp_user_engagements_interface is returning null if the user marks the forum as hidden. For now, we have told them not to do this, but we are concerned that a user action using the ui can cause such fatal errors. While we were troubleshooting I bypassed the error by adding a ? in the code to avoid the fatal error on null. This brought the site back up while we investigated the cause

    `$retval = bbp_user_engagements_interface( $rel_key, $rel_type )?->get_users_for_object( $object_id, $rel_key, $rel_type );


    Robin W
    Moderator

    @robin-w

    that’s great – thanks

    so on my test site, I hid a forum and logged in as a participant, and the index shows fine.

    so we need to work out what the difference between your site and my test site is.

    so initially let’s eliminate outside factors such as a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    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

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