Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1043 closed defect (bug)

Logged in users can not post comments.

Reported by: cavemonkey50's profile cavemonkey50 Owned by:
Milestone: Priority: normal
Severity: major Version: 1.5.1
Component: Template Keywords:
Focuses: Cc:

Description

When using the <?php if ( $user_ID ) : ?> tag to bypass and hide the comment fields, logged in users lose the ability to post comments. Their comment will always fail with the error invalid email. Guests are unaffected by the bug and can comment as normal.

Attachments (2)

comments1.php (5.4 KB) - added by cavemonkey50 19 years ago.
comments2.php (5.7 KB) - added by cavemonkey50 19 years ago.

Download all attachments as: .zip

Change History (10)

#1 @cavemonkey50
19 years ago

  • Patch set to No

#2 @2fargon
19 years ago

  • Status changed from new to assigned

Are you trying to modify the template, and use a hack to bypass the comment fields?

Can you please describe how to reproduce the bug, with detailed steps?

#3 @MC_incubus
19 years ago

It's possible that you have the "require e-mail" setting ON and your users don't have e-mail addresses set.

See also: http://mosquito.wordpress.org/view.php?id=948

#4 @cavemonkey50
19 years ago

Well, first of all no hacks are used. Second, require email setting is on, but the users have a correct email set.

I have attached two files. In comments1.php, the template code I was attempting to use is used. In comments2.php I have modified the <?php if ( $user_ID ) : ?> section to include hidden fields of the name, email, and url. Line 82 in both files is the starting point of the relating comment code.

comments2.php is currently working for me, however I'm not sure if that's how the comments.php was intended to be used. In all of the themes I was looking at there were no hidden fields in the <?php if ( $user_ID ) : ?> section of the template. I probably should mention that the template I'm using is my own custom template, but I have insure I am not missing any tags.

Again, to repeat this problem, when using comments1.php, a logged in user's comment will fail and a guest who's name, email, and url fields showing will not. comments2.php will work correctly. If you need any additional information, just let me know.

#5 @cavemonkey50
19 years ago

Scratch that. The fix I worked on this morning didn't work. I'll look into it more and see if I can find anything else.

#6 @cavemonkey50
19 years ago

I've done a little more testing. I have tried this on today's nightly and the 3/5 one. I have used my theme and the default theme. Both themes will return the error I was talking about. However, if I had the hidden fields as mentioned before it will work.

I have also tried deleting my email and readding it, in hopes that WP will reestablish something in the database it was looking for. This did not prove sucesssful. I'm kind of stuck now. Not sure what I should test. I'm going to try and completely delete my WP files (except the database) and reinstall. Has this been reproduced by anyone?

#7 @anonymousbugger
19 years ago

I found out some more information with this bug. It seems that using the hidden values only work 50% of the time. The hidden values rely on <?php echo $comment_author_email; ?> and other tags. What happens is the tag doesn't pass anything sometimes. This will leave the email field blank, causing the error I am experiencing. If you have previously left a comment a cookie will remember your email setting, so that's my guess on why it's working for some people. Try clearing your cookies and then log in to WP and try and comment.

#8 @cavemonkey50
19 years ago

Close this bug. The problem was an old hack that was using my-hacks.php to force a valid email. This hack in not compatible with WP 1.5. I was disabling plugins but not my-hacks.php so I didn't catch it. Fixed it and everything is working as expected.

#9 @2fargon
19 years ago

  • Status changed from assigned to closed

Not an issue.

Note: See TracTickets for help on using tickets.