Skip to:
Content
Pages
Categories
Search
Top
Bottom

PHP fatal error in debug.log


  • alriknijdam
    Participant

    @alriknijdam

    Hi there

    I came across a fatal PHP error in my debug.log. Hope you can fix this or help me fix it.
    PHP Fatal error: Cannot redeclare bp_members_screen_display_profile() (previously declared in /.../buddypress/bp-members/screens/profile.php:22) in /.../buddypress/bp-members/screens/profile.php on line 32

    WordPress version: 4.9.8
    BuddyPress version: 3.2.0
    Site: https://vespa-ciao.nl

    Best regards,
    Alrik

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

  • Venutius
    Moderator

    @venutius

    By the sounds of it you have two plugins trying to declare the same function name. Deactivate all of your plugins apart from BuddyPress, if the error remains try switching themes to 2016, if that fails then it’s custom code you’d added via function.php, bp-custom.php etc.


    alriknijdam
    Participant

    @alriknijdam

    Tricky part is I can’t just disable all plugins since I got quit a few users. I also don’t know how to duplicate this error so disabling them for a short time to see if the error remains isn’t an option as well.
    Is there any possibility that you can point me a little bit more in the right direction? Maybe if I sum up all the plugins in use?

    Best regards,
    Alrik


    Venutius
    Moderator

    @venutius

    In that position, I’d download the plugins directory and do a search through the contents using something like Notepad++ Search in Files


    alriknijdam
    Participant

    @alriknijdam

    Great tip, I’ll look into that asap and let you know.

    Thanks,
    Alrik


    alriknijdam
    Participant

    @alriknijdam

    Alright, I’ve downloaded my entire WP directory and searched for bp_members_screen_display_profile with Notepad++ Search in Files. But the only files showing hits belong to Buddypress.

    F:\\wp-content\plugins\buddypress\bp-members\classes\class-bp-members-component.php (3 hits)
    	Line 329: 				'screen_function'     => 'bp_members_screen_display_profile',
    	Line 346: 			'screen_function' => 'bp_members_screen_display_profile',
    	Line 359: 				'screen_function'     => 'bp_members_screen_display_profile',
    F:\\wp-content\plugins\buddypress\bp-members\classes\class-bp-members-theme-compat.php (1 hit)
    	Line 58: 			do_action( 'bp_members_screen_display_profile' );
    F:\\wp-content\plugins\buddypress\bp-members\screens\profile.php (3 hits)
    	Line 15: function bp_members_screen_display_profile() {
    	Line 22: 	do_action( 'bp_members_screen_display_profile' );
    	Line 31: 	bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );

    CRITICAL Cannot redeclare bp_members_screen_display_profile() (previously declared in /wp-content/plugins/buddypress/bp-members/screens/profile.php:22) in /wp-content/plugins/buddypress/bp-members/screens/profile.php line 32

    How to go from here?

    Best regards,
    Alrik


    Venutius
    Moderator

    @venutius

    Next step would be to Download your childtheme contents and do the same lookup.


    alriknijdam
    Participant

    @alriknijdam

    This was already including my childtheme & custom functions.php.
    Literally everything slightly related to wordpress was checked.

    Best regards,


    Venutius
    Moderator

    @venutius

    That’s really strange, you can see in the files you have scanned that the function is only being declared once.


    alriknijdam
    Participant

    @alriknijdam

    I performed the search again. This time I downloaded ALL files from my vps. The results are still the same.

    Can’t say I understand recursive functions in php but they seem to work. Just looks so strange to call a function inside itself. In this instance; How does do_action( 'bp_members_screen_display_profile' ); actually know what to do?

    function bp_members_screen_display_profile() {
    
    	do_action( 'bp_members_screen_display_profile' );
    
    	bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
    }

    Is there anything I can do to help out and dig a little bit deaper?

    Best regards,
    Alrik


    Venutius
    Moderator

    @venutius

    the do_action is not calling the function, it’s setting up an action hook that fires whenever that function is called.

    I’m at a loss as to what to do next, you may need to call in an expert. The error itself is simple enough, finding the culprit has gotten problematic.


    alriknijdam
    Participant

    @alriknijdam

    Saw you guys released 4.0.0 so I deinstalled the old version, did some repairs on the database and installed the new version of buddypress. So far so good, in 24 hours this fatal error has not popped up again. Let’s hope it stays that way 🙂

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