Opened 13 years ago
Closed 13 years ago
#25127 closed defect (bug) (fixed)
Saving an empty draft sticky post leads to auto-drafts being marked as sticky
| Reported by: | druesome | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Administration | Version: | 3.6 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description (last modified by )
If you save an empty post set as sticky as draft it increments number of Sticky Posts because the auto-draft's ID ends up in the list of sticky posts:
To reproduce error:
- Create New Post, leave everything empty
- Tick 'Stick this post to the front page'
- Click Save as Draft
Reproduced in a clean install of WordPress v3.6, default theme with no plugins activated.
Attachments (1)
Change History (8)
#2
@
13 years ago
- Component Administration → General
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
#4
@
13 years ago
- Description modified (diff)
- Keywords needs-patch added
- Milestone → 3.7
- Resolution duplicate
- Status closed → reopened
- Summary Missing Empty Posts → Saving an empty draft sticky post leads to auto-drafts being marked as sticky
Re-opening and focusing on the specific different issue from the other tickets and a specific issue which can easily be solved independently.
#5
@
13 years ago
- Cc added
- Keywords has-patch added; needs-patch removed
The problem is that wp_insert_post breaks earlier when an empty post has been found and assigned as true to the $maybe_empty variable. Initially, a post has a status of auto-draft which isn't updated to draft unless there is any valid data in the title or content.
IMO this makes sense and also happens when you skip step 2 (i.e. just hit 'Save Draft' for an empty post).
My proposal is just counting the sticky posts properly by ignoring auto-draft posts as well.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)

Related: #17115, #23623, #23887.