problem after creating a blog with logged in user

Hej!

When creating a new blog with a signed in user, There is a problem with the output.

This happens always and just for logged in users.

Removing the "ob_end_clean" on the "signup_finished" filter makes the problem disappear.

Sounds like its the same problem as this ticket: https://premium.wpmudev.org/forums/topic/white-screen-after-creating-new-blog-when-user-logged-in

Please advise,
Thanks,

Koff

  • koff
    • Site Builder, Child of Zeus

    Hej,

    I did some research.
    The problem is that when a logged in user create a blog no "ob_start" is called.
    and ob_end_clean() cleans the buffer.

    So that's what I did:

    1. I removed the action on line 48:

    // End activation message display
    //add_action( 'signup_finished', 'activated_signup_finished', 1 );

    And I added the same line twice,one for every ob_start() call,

    Line 145:

    // Now we need to hijack the sign up message so it isn't displayed
    	ob_start();
    	add_action( 'signup_finished', 'activated_signup_finished', 1 );

    and Line 198:

    // Now we need to hijack the sign up message so it isn't displayed
    	ob_start();
    	add_action( 'signup_finished', 'activated_signup_finished', 1 );

    I would like to get a comment on this one from the developer though.

    Thanks,

    Koff

  • aecnu
    • WP Unicorn

    Greetings koff,

    Thank you for posting your custom coding fix for other members to benefit.

    Personally if memory serves me well, I was just adding <?php ob_start(); ?> before <!DOCTYPE html> tag in header.php to fix the header warning messages.

    But I am not 100% on this.

    I would like to get a comment on this one from the developer though.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • aecnu
    • WP Unicorn

    Greetings Ed Cooper,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

  • koff
    • Site Builder, Child of Zeus

    Hi Barry,

    I saw your fix on 2.1.1

    Because Output buffers are stackable its good practice to have the ob_start() and ob_end_clean() coupled, and not use if(ob_get_level() > 0 ) ob_end_clean(); method.

    This can theoretically cause a very hard to catch problem in the future.

    if you add the 'signup_finished' action with each ob_start() call, this is safer.

    Thanks,

    Koff

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.