#20662 closed defect (bug) (fixed)
private post can be sticky via quickedit
Reported by: | maxemil | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
While preparing translations to 3.4 I came across
http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-xmlrpc-server.php#L908
This indicates that a private post cannot be marked as sticky.
- however it is quite possible to mark a private post as sticky while using quickedit.
Solution proposal, remove sticky tickbox on quickedit if post is private.
Or if this is only related to the XMLRPC, fix the returnmessage to a warning "a private post will only be visible to you, so sticky might not make any sense".
I'm thinking.. "either its possible or its not, the logic should be the same"
Attachments (6)
Change History (35)
#2
@
9 years ago
- Keywords needs-patch good-first-bug added
- Type changed from enhancement to defect (bug)
This is a bug because mw_newPost's logic in that file allows a sticky post to be a private post whereas mw_editPost and _insert_post do not
#3
@
9 years ago
- Keywords needs-patch good-first-bug removed
- Milestone changed from Awaiting Review to 4.3
- Owner set to chriscct7
- Status changed from new to accepted
#5
@
9 years ago
Apparently postdata doesn't contain sticky. content_struct does. Patch 2 fixes this.
#7
@
9 years ago
If we add it inside the if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
check, we can remove the sticky check.
#8
@
9 years ago
20662.diff refreshes this.
#9
@
9 years ago
@wonderboymusic, there is a similar check further up in the file, doing an edit_others_posts
cap verification. Should we do that here too? Might be worth making both checks work the same, what do you think?
#10
@
9 years ago
20662.2.diff adds a helper that can be used in all 3 places where a post can be stuck
#12
@
9 years ago
20662.3.diff fixes the bug for quick edit.
@wonderboymusic, your patch should go in as well, do you know of a good way for me to test it?
#13
@
9 years ago
- Owner changed from chriscct7 to wonderboymusic
- Status changed from accepted to assigned
#15
@
9 years ago
- Keywords needs-docs added
- Resolution fixed deleted
- Status changed from closed to reopened
The DocBlock for _toggle_sticky()
is incomplete. At the very least, we need a summary describing what purpose the function serves. Adding description for why it's private is also a good idea.
This ticket was mentioned in Slack in #core by obenland. View the logs.
9 years ago
#19
@
9 years ago
- Keywords has-patch added; needs-docs removed
- Resolution fixed deleted
- Status changed from closed to reopened
How could this land without any unit tests?
wp_xmlrpc_server::mw_editPost()
fails making a post sticky becaue of the missing post_type
, see 20662.4.diff.
yes, the logic should be the same. Added dev-feedback to define that the right way is for handling sticky posts.
Wonder if private isn't allowed we should add the check into stick_post().