#2445 closed defect (bug) (fixed)
comment_status and ping_status ignored on publish/first save
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | high | |
| Severity: | major | Version: | 2.0.1 |
| Component: | Administration | Keywords: | comments bg|has-patch bg|2nd-opinion bg|dev-feedback |
| Focuses: | Cc: |
Description (last modified by )
When writing a new entry the checkboxs "Allow Comments" and "Allow Pings" are being ignored on publish or first save. When you deactivate "Allow Comments" or "Allow Pings" and click on "Save and Continue Editing" the checkbox is checked again. If you click "Publish" and re-edit the post, the checkbox will be checked again. The checkbox only works when you update an entry but not when it's saved for first time or published without first saving.
Updated to include ping_status and for clarity - markjaquith
Attachments (2)
Change History (17)
#1
@
20 years ago
- Keywords bg|needs-patch added
- Milestone set to 2.1
- Owner changed from anonymous to markjaquith
- Priority changed from normal to high
- Severity changed from normal to major
- Status changed from new to assigned
#2
@
20 years ago
- Description modified (diff)
- Summary changed from comment_status ignored on first save to comment_status and ping_status ignored on publish/first save
Ditto for the ping setting
#4
@
20 years ago
- Keywords bg|has-patch bg|2nd-opinion bg|dev-feedback added; bg|needs-patch removed
The code is currently checking if the field is empty and if so setting to get_settings('default_comment_status') or get_settings('default_ping_status')
Of course, if you uncheck the boxes, they will be empty, so they'll be set to the default status.
I think the default status should only be used to check or uncheck the boxes when you first load the Write screen. If you save/publish a post and the settings are empty, it should treat them as unchecked and make the setting 'closed'
My patch makes that change.
#5
@
20 years ago
The plugin I uploaded fixes the issue for people who are not comfortable applying patches.
#6
@
20 years ago
This might break importers and xmlrpc which sometimes rely on wp_insert_post() setting the proper default status if nothing is passed in. I think we can accommodate everyone by distinguishing between not set and set but empty.
#7
@
20 years ago
When comment_status or ping_status is unchecked, nothing is passed in. It doesn't even exist in the $_POST array. So we can't distinguish using "set but empty" because it never is.
How about distinguishing between import/XMLRPC and normal WP web interface? We could assume default for import/XMLRPC and assume "closed" for WP web interface.
#8
@
20 years ago
edit_post() in admin-functions sets ping_status in $_POST to 'closed'. write_post() should do the same thing but it doesn't. The fix can be made there.
#9
@
20 years ago
Victory. Someone else try the uploaded patch. Make sure that your default is comments/pings ON. Write, uncheck "allow comments" and "allow pings," publish, and re-edit the post to see if it stuck.
#12
@
20 years ago
Ah, good to see this fixed. I reported this same issue back at the end of November, but mistakenly closed it for some reason (no clue as to why).
Confirmed in 2.0.1 and latest SVN as of the time of this comment.