• Resolved duhlina

    (@duhlina)


    I need GD bbpress as there does not appear to be another plugin that does the specific needs that I have from it. It seems to have developed a global issue as when the plugin is added to a test site the same error occurs. It is not a huge deal but starting to get annoying with an email every morning telling me that the same issue is still there and it may crash my site:
    ……………………………………………………………………………

    Error Details
    =============
    An error of type E_ERROR was caused in line 71 of the file /home/xoauig0ctjrg/public_html/wp-content/plugins/gd-bbpress-tools/code/mods/signature.php. Error message: Uncaught Error: Attempt to assign property "filter" on null in /home/xoauig0ctjrg/public_html/wp-content/plugins/gd-bbpress-tools/code/mods/signature.php:71
    Stack trace:
    #0 /home/xoauig0ctjrg/public_html/wp-includes/class-wp-hook.php(307): GDBTOModSignature->editor_form_profile()
    #1 /home/xoauig0ctjrg/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 /home/xoauig0ctjrg/public_html/wp-includes/plugin.php(476): WP_Hook->do_action()
    #3 /home/xoauig0ctjrg/public_html/wp-admin/user-edit.php(838): do_action()
    #4 /home/xoauig0ctjrg/public_html/wp-admin/profile.php(18): require_once('/home/xoauig0ct...')
    #5 {main}
      thrown

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same thing happening here on PHP 8.0 and WP 6.0:

    2022/06/09 01:07:50 [error] 15492#15492: *4500220 FastCGI sent in stderr: "PHP message: PHP Warning:  Attempt to read property "filter" on null in [REDACTED]/wp-content/plugins/gd-bbpress-tools/code/mods/signature.php on line 70PHP message: PHP Fatal error:  Uncaught Error: Attempt to assign property "filter" on null in [REDACTED]/wp-content/plugins/gd-bbpress-tools/code/mods/signature.php:71
    Stack trace:
    #0 [REDACTED]/wp-includes/class-wp-hook.php(307): GDBTOModSignature->editor_form_profile()
    #1 [REDACTED]/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 [REDACTED]/wp-includes/plugin.php(476): WP_Hook->do_action()
    #3 [REDACTED]/wp-admin/user-edit.php(847): do_action()
    #4 {main}
      thrown in [REDACTED]/wp-content/plugins/gd-bbpress-tools/code/mods/signature.php on line 71" while reading response header from upstream, client: [REDACTED], server: [REDACTED], request: "GET /wp-admin/user-edit.php?user_id=3125&wp_http_referer=%2Fwp-admin%2Fusers.php%3Fs%3Dmordisko%26action%3D-1%26new_role%26bbp-new-role%26bbp-bulk-users-nonce%3Db296c763a6%26paged%3D1%26action2%3D-1%26new_role2%26bbp-new-role2 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.0-fpm.sock:", host: "[REDACTED]"
    

    The problem seems to be that $profileuser is no longer a global variable. Solved it by declaring that as a parameter.

    In order to solve it I edited the file “wp-content/plugins/gd-bbpress-tools/code/mods/signature.php” by replacing the whole editor_form_profile function for the following:

    public function editor_form_profile($profileuser) {
        if (!is_admin()) {
            return;
        }
    
        $old_filter = $profileuser->filter;
        $profileuser->filter = 'display';
    
        $_signature = d4p_bbp_update_shorthand_bbcodes($profileuser->signature);
    
        $profileuser->filter = $old_filter;
    
        $form = apply_filters('d4p_bbpresstools_signature_editor_file', GDBBPRESSTOOLS_PATH.'forms/tools/signature_profile.php');
        include_once($form);
    }

    I can’t confirm that this will work for everyone, but so far I can edit a user profile and modify it’s BBPress settings (which I couldn’t do before) and no more HTTP 500 errors seem to be happening.

    • This reply was modified 2 years, 5 months ago by mordisko.

    Hi @mordisko I applied your fix and tested modifying the Profile (and signature) it all seems to work. Thanks!

    I have not seen errors anymore, so far, but cannot be sure because I have not been able to reproduce the errors deliberately. I just got warning mails from time to time but have no idea when/how the issue is triggered exactly. I’ll report back here if the error occurs again ??

    Thread Starter duhlina

    (@duhlina)

    This worked for me as well!
    THANK YOU, THANK YOU, THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attempt to assign property “filter” on null’ is closed to new replies.