Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#8740 closed defect (bug) (fixed)

Pages do not respect Automatically close comments setting

Reported by: ladyanna's profile LadyAnna Owned by:
Milestone: 2.7.1 Priority: normal
Severity: minor Version: 2.7
Component: Comments Keywords: comments "auto-close comments" page has-patch
Focuses: Cc:

Description

I checked inside the database to make sure it was not a theme related bug. I then noticed that the status was unchanged.
comment_status remains as open in database (wp_posts table) even after the set time limit is passed.

Example: If I set wordpress to auto close comments after 5 days, on the 6th day database still shows comment_status as open.

Since the status is not changed the checks within a theme to show or hide comment form fails, and the form is always shown.

It works as intended for a normal post, it is only with pages the bug occur.

You can not comment on a page that is older then the limit though, you get an error saying "Sorry, comments are closed for this item." I'm guessing that is through a check on submit.

Attachments (1)

comment.diff (457 bytes) - added by mrmist 15 years ago.
Fix to close comments for Pages

Download all attachments as: .zip

Change History (8)

#1 @mrmist
15 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.8 to 2.7.1
  • Summary changed from Update comment_status column where post_type=page (column is NOT updated properly) to Pages do not respect Automatically close comments setting

Confirmed against trunk.

This looks like an oversight. Pages will still display the comment box.
Unfortunately I can't see why there's a difference, so can't write the patch myself.

Updated summary. (was Update comment_status column where post_type=page (column is NOT updated properly))

#2 @mrmist
15 years ago

  • Keywords has-patch added; needs-patch removed

Attached patch for comment.php against trunk. Seems to work for me, may need some testing.

#3 @DD32
15 years ago

Just a quick note: When your using the "Close after xx days" functionality, the value is NOT changed in the database, Its all done on the fly inside WordPress.

mrmist: I believe you've used | instead of
in your patch :)

@mrmist
15 years ago

Fix to close comments for Pages

#4 @mrmist
15 years ago

Indeed so... :)

#5 @ryan
15 years ago

I think we can use is_singular() here.

#6 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10273]) Close comments for old posts, pages, and attachments, not just posts. Props mrmist. fixes #8740

#7 @ryan
15 years ago

(In [10274]) Close comments for old posts, pages, and attachments, not just posts. Props mrmist. fixes #8740 for 2.7

Note: See TracTickets for help on using tickets.