Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33490 closed defect (bug) (fixed)

Comments for WordPress 4.3 to be default "off" for pages but 1 remains

Reported by: asilver's profile asilver Owned by: swissspidy's profile swissspidy
Milestone: 4.3.1 Priority: normal
Severity: normal Version: 4.3
Component: Upgrade/Install Keywords: good-first-bug fixed-major has-patch commit
Focuses: Cc:

Description

Hi

With the 4.3 release, Comments are supposed to be default "off" on pages. In testing I found the Sample-Page isn't set correctly, with comments "on" as default. This could be confusing to new users to WordPress.

I took the 4.3 zip from .org, not an install from a hosting company auto installer.

Attachments (4)

33490.diff (468 bytes) - added by macmanx 9 years ago.
creates sample page with comments switched off on install
33490.2.diff (488 bytes) - added by asilver 9 years ago.
using the function which returns the globally default comment status instead of just using closed
33490.3.diff (500 bytes) - added by asilver 9 years ago.
Updated from v2 with correct arg
33490.4.diff (496 bytes) - added by asilver 9 years ago.

Download all attachments as: .zip

Change History (16)

#1 @MikeHansenMe
9 years ago

  • Keywords needs-patch good-first-bug added

#2 @swissspidy
9 years ago

  • Component changed from General to Upgrade/Install
  • Focuses ui removed
  • Milestone changed from Awaiting Review to 4.3.1
  • Owner set to swissspidy
  • Status changed from new to accepted

Thanks for your report, asilver, and welcome to Trac!

I can confirm this. comment_status isn't set when creating the page in wp_install_defaults() because it uses $wpdb->insert() directly. get_default_comment_status() should be used here.

I think this bug is worth fixing as part of 4.3.1 for the reason mentioned above.

@macmanx
9 years ago

creates sample page with comments switched off on install

#3 @macmanx
9 years ago

  • Keywords has-patch added; needs-patch removed

Uploaded patch 33490.diff which will create the sample page with comments off on install.

#4 @kraftbj
9 years ago

Confirmed 33490.diff resolves. New install's Sample Page is 100% less open for comments.

#5 @wonderboymusic
9 years ago

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

In 33693:

When createing "Sample Page" on install, comments should be closed.

Props macmanx.
Fixes #33490.

@asilver
9 years ago

using the function which returns the globally default comment status instead of just using closed

#6 @kraftbj
9 years ago

  • Keywords needs-patch added; has-patch removed

@asilver - you'll need to use the post type arg, e.g. get_default_comment_status( 'page' ); Otherwise, it'll default to 'post' (the default), which would set it as open.

Last edited 9 years ago by kraftbj (previous) (diff)

#7 @asilver
9 years ago

@kraftbj -

gotcha and thanks.
Learning!

#8 @helen
9 years ago

  • Keywords fixed-major added; needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

@asilver
9 years ago

Updated from v2 with correct arg

@asilver
9 years ago

#9 @asilver
9 years ago

V4 has fixed quotes. Pressed enter to quickly.

#10 @netweb
9 years ago

  • Keywords has-patch commit added

Thanks @asilver, 33490.4.diff looks good.

#11 @SergeyBiryukov
9 years ago

I don't see a reason to use get_default_comment_status() here. It's 'closed' for pages by default, and plugins cannot change it during the install, so [33693] seems enough.

#12 @wonderboymusic
9 years ago

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

In 33950:

When creating "Sample Page" on install, comments should be closed.

Props macmanx.
Cherry-picks [33693] onto 4.3 branch.
Fixes #33490 for 4.3.

Note: See TracTickets for help on using tickets.