#9200 closed defect (bug) (duplicate)
comment widget links draft articles
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.7 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
the wp 2.7.1 standard widget for the latest comments lists comments that are posted to a draft article. if the link is clicked, wordpress does not display the article because it is in draft state.
reproduceablity: every time.
how: create an article, plublish it, comment it, set the articles state to draft.
Change History (9)
#2
@
15 years ago
- Milestone 2.7.2 deleted
- Resolution set to wontfix
- Status changed from new to closed
#3
@
15 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
Please provide a link to the duplicate, would like to see that.
The level of manual interaction with the software WordPress should not be an argument against the fact, that it is a bug. At least it isn't from my point of view.
I did report the ticket here to send in a patch by myself because this single incidence I reported here already shows that the checks performed in the widget are not fully reflecting the underlying database structure.
So for better reference, please provide a link to the other ticket you were writing about and I re-open it because I plan to fix it, even though you might not want to fix it, because you trust all users input.
Thanks for your cooperation.
#4
@
15 years ago
Just took a look in the source: Nothing is checked in the widgets, it's aboslutely independent from the posts table, it's onyl about comments.
information about posts is looked up only afterwards while iterating over the results from the comments database queries.
what is needed is a join on the posts table to gain the posts status for the post the comment is related to.
luckily comment_post_ID and post_status are indexed so that using a join in this query should do the job without any further notice. only a check for post_status: 'draft' has to be added.
next to patching the database query a fix for the user would be to set the comments not being approved (comment_approved: '0'). this could be done just in case in the article editor while saving a draft.
the last might be a nicer fix then changing the query in the widget.
#5
@
15 years ago
If you take a look to my solution for the similar problem with 'private' entries (http://core.trac.wordpress.org/ticket/9211), you'll see I took a look to your ticket.
I think that what you need could be done by adding
AND p.post_status<>'draft'
in the WHERE clause of the query I modified in the other ticket.
#6
@
15 years ago
See #8169 previously closed by Ryan.
I think the wontfix was right. I disagree with increasing the cost of the query that produces the widget for an edge-case like this. Your editors should be attending to the workflow, rather than having the software jump through hoops.
This has been raised before. I'm pretty sure it was closed as wontfix last time, because in order to create the "bug" you have to publish an article, wait for comments on it, and then set that article to draft status, which is really odd workflow.