[wp-hackers] wp-comments-post.php & file upload problem

Mark Cunningham mark.cunningham at gmail.com
Thu Feb 28 12:28:11 GMT 2008


On 26/02/2008, Otto <otto at ottodestruct.com> wrote:
> $id is a global at that point and should indeed be defined. It's
>  defined by setup_postdata(), which is called by the_post(). Whenever
>  you're in a Loop, the $id global is valid.

I was aware that $id was global.

>  So echo $id should return the post id. It should never be blank.

I know. But I observed it being blank when I hit the "blank page after
comment submit" and then returned back to the submitting page and
checked the source.

I'm afraid I was not able to reliable reproduce it. What I did
discover was that it never seemed to occur if logged in as the
administrator. It did occur more often logged out. And when I was
using the paged-comments plugin, slightly more often.

>  What's the URL of the page with the comments form on it? Is this the
>  popup form or not?

I'm afraid it's not the popup form. It was occuring here:
http://thedeadone.net/demos/tdof/ with a theme I was playing around
with, but I've since fixed it. I've been told by users on my main blog
(thedeadone.net) that occurs to them frequently but I'm using
paged-comments there so that could be the source there.

>  On Tue, Feb 26, 2008 at 7:53 AM, Mark Cunningham
>
> <mark.cunningham at gmail.com> wrote:
>  > It's in Wordpress 2.3.3 the default and classic themes, in the file
>  >  comments.php. It uses "$id". So it looks like it's "latest standards
>  >  and practises".
>  >
>  >  However, at least on the blog I found it on, it was using the plugin
>  >  paged-comments plugin that might have been causing $id to be empty.
>  >
>  >  I just wanted to note that you can reproduce the blank screen when
>  >  posting a comment if the $id variable in the comments form equates to
>  >  empty. If Beth is see this problem occur frequently, you can double
>  >  check it: when it happens, go back in your browser and check the
>  >  source of the comment form. If you see comment_post_ID with an empty
>  >  value, it would be the cause. Something like this:
>  >
>  >  <input type="hidden" name="comment_post_ID" value="" />
>  >
>  >  The value field should be equal to the post id of the post.
>  >
>  >
>  >
>  >  On 26/02/2008, Viper007Bond <viper at viper007bond.com> wrote:
>  >  > Sounds like an old, poorly coded them.
>  >  >
>  >  >  Make sure to check the /default/ theme for the latest standards and
>  >  >  practices.
>  >  >
>  >  >
>  >  >  On 2/26/08, Mark Cunningham <mark.cunningham at gmail.com> wrote:
>  >  >  >
>  >  >  > On 25/02/2008, Beth Cleaver <cleavere at bellsouth.net> wrote:
>  >  >  > >  My problem*:  I can't comment on mccainblogs.com; I get the dreaded
>  >  >  > >  blank screen stuck on wp-comments-post.php, no redirect to the original
>  >  >  > >  post, and no comment gets posted.  I've seen this issue in the WP
>  >  >  > forums
>  >  >  > >  and elsewhere around the internets, but I can't find a solution that
>  >  >  > >  applies even closely enough to help me figure it out.
>  >  >  >
>  >  >  >
>  >  >  > I don't know if this is the same thing I found on my blog (wp-2.3.3)
>  >  >  > but I found, occasionally, people would try to submit a comment and
>  >  >  > would get a blank screen. Tracked it down to the comment form in my
>  >  >  > theme. In my "comments.php", I had, right down the bottom of the form
>  >  >  > this line:
>  >  >  >
>  >  >  > <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
>  >  >  >
>  >  >  > For some reason "$id" would be empty sometimes, particularly for
>  >  >  > non-logged in users. I replaced it with this:
>  >  >  >
>  >  >  > <input type="hidden" name="comment_post_ID" value="<?php echo $post->ID;
>  >  >  > ?>" />
>  >  >  >
>  >  >  > And the problem seemed to go away.
>  >  >  >
>  >  >  >
>  >  >  > --
>  >  >  > http://thedeadone.net
>  >  >  > http://irishgamingwiki.com
>  >  >  >
>  >  >
>  >  > > _______________________________________________
>  >  >  > wp-hackers mailing list
>  >  >  > wp-hackers at lists.automattic.com
>  >  >  > http://lists.automattic.com/mailman/listinfo/wp-hackers
>  >  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  > --
>  >  >  Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/
>  >  >
>  >  > _______________________________________________
>  >  >  wp-hackers mailing list
>  >  >  wp-hackers at lists.automattic.com
>  >  >  http://lists.automattic.com/mailman/listinfo/wp-hackers
>  >  >
>  >
>  >
>  >  --
>  >
>  >
>  > http://thedeadone.net
>  >  http://irishgamingwiki.com
>  >  _______________________________________________
>  >  wp-hackers mailing list
>  >  wp-hackers at lists.automattic.com
>  >  http://lists.automattic.com/mailman/listinfo/wp-hackers
>  >
>  _______________________________________________
>  wp-hackers mailing list
>  wp-hackers at lists.automattic.com
>  http://lists.automattic.com/mailman/listinfo/wp-hackers
>


-- 
http://thedeadone.net
http://irishgamingwiki.com


More information about the wp-hackers mailing list