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

Otto otto at ottodestruct.com
Tue Feb 26 16:39:45 GMT 2008


$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.

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

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


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
>


More information about the wp-hackers mailing list