• Resolved oyajipunk

    (@oyajipunk)


    I am using WP 2.3.1 with the cloudy theme and am experiencing the below problem:

    An unregistered user can add comments to a post no problems, providing I have the “Users must be registered and logged in to comment” box in the Options part of the admin panel unchecked. The comment is visible on the blog until I log into the admin panel to moderate it (moderation is switched on), at which point it disappears from the main view below the post. I am using the admin panel in one tab of my web browser, and browsing the blog on another at the same time so this may be a normal “glich”.

    The real problem is this. The minute I pop a check box in “Users must be registered and logged in to comment”, comments no longer work and I get the white screen of death when the comment is submitted (wp-comments-post.php).

    I have tried overwriting the wp-comments-post.php file with a known good one, switching off my only plugin (category order), and fiddled with all the settings I can find in wordpress admin, but no way can I get comments to work with registered users. I ran the validator.w3.org test on some of the post pages too but no errors were found.

    Any ideas? Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey, I don’t have a solution for you. Just stating that I am having the exact same problem and posted a message about it yesterday.

    I do not have moderation activated, and unregistered users can post. However, if I log in and try to leave a post, I get the same “white page of death”.

    I did discover I can leave logged in comments from the standard template but not from the one I am using. So here is the complete form methods for each template:

    From Current Template:

    <form action="https://joshlowe.com/wp-comments-post.php" method="post" id="commentform">
    
    	<p>Logged in as <a href="https://joshlowe.com/wp-admin/profile.php">Josh</a>. <a href="https://joshlowe.com/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a><input type="hidden" id="author" value="Josh" /><input type="hidden" id="email" value="" /><input type="hidden" id="url" value="" /></p>
    
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
     <p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
    
    <p><input name="submit" type="submit" class="button" id="submit-button" tabindex="5" value="Submit Comment" /></p>
    
    </form>

    ——————

    From standard template:

    <form action="https://joshlowe.com/wp-comments-post.php" method="post" id="commentform">
    
    <p>Logged in as <a href="https://joshlowe.com/wp-admin/profile.php">Josh</a>. <a href="https://joshlowe.com/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a></p>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><a href=&quot;&quot; title=&quot;&quot;> <abbr title=&quot;&quot;> <acronym title=&quot;&quot;> <b> <blockquote cite=&quot;&quot;> <cite> <code> <del datetime=&quot;&quot;> <em> <i> <q cite=&quot;&quot;> <strike> <strong> </code></small></p>-->
    
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="25" />
    </p>
    <input type="hidden" id="_wp_unfiltered_html_comment" name="_wp_unfiltered_html_comment" value="f1ae8c6969" />
    </form>

    ———————

    Main differences between the two that I see:

    Current Template send Author, Email, and Website through hidden forms; Standard Template does not send them at all.

    Standard Template sends a “comment_pst_ID” and “_wp_unfiltered_html_comment” through hidden ids; Current Template does not send them at all.

    Thread Starter oyajipunk

    (@oyajipunk)

    Is it possible that developers of themes have intentionally changed the code to simplify the implementation of their theme? Perhaps some themes cause registration conflicts, so they just remove all the registration functions from the background, but forgot to tell us to switch off the “users must be registered” function in admin?

    There must be some theme developers on this board who know the answer. If it is just an unintentional glitch, then perhaps we can just insert the standard “comments-pst-id” and “wp-unfiltered-html-comment” files into the new theme?

    Ok, I just got mine to work.

    I edited the comments.php file for the theme that I was having difficulty with. The problem was the comments_post_ID was ONLY being sent when not logged in. IF a user is logged in, it outputs one thing, while IF a user is NOT logged in, it outputs other data. The problem is that the comments_post_ID was outputted for no login, but not when someone IS logged in. Does that make sense? So, all I had to do was add the line after the form submit button, and it worked! I hope this works for you.

    Here is what I had originally in my comments.php file surrounding the form submit button:

    <input name="submit" type="submit" class="button" id="submit-button" tabindex="5" size="22" value="Submit Comment" />

    Here is what I changed it to:

    <input name="submit" type="submit" class="button" id="submit-button" tabindex="5" size="22" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

    Just add that second line after the form submit button (or before it), just make sure it’s outside of the loops that involve whether someone is logged in or not logged in.

    Thread Starter oyajipunk

    (@oyajipunk)

    Worked perfectly. Thanks!!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘White screen of death when posting’ is closed to new replies.