Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Conversation

@joehoyle
Copy link
Member

@joehoyle joehoyle commented Oct 3, 2016

Currently we don't allow updating a comment type, however in the update
code we are checking the raw value vs get_comment_type() which means a
comment of type "comment" can not be updated, as that's actually an
empty value in the database.

Currently we don't allow updating a comment type, however in the update
code we are checking the raw value vs get_comment_type() which means a
comment of type "comment" can not be updated, as that's actually an
empty value in the database.
@rmccue rmccue added the Bug label Oct 3, 2016
@rachelbaker
Copy link
Member

Related core ticket that would be the IDEAL solution: https://core.trac.wordpress.org/ticket/38200

@rachelbaker
Copy link
Member

rachelbaker commented Oct 3, 2016

@joehoyle the default value for the type parameter is '' in the schema, that should be updated to be comment to match. https://github.com/WP-API/WP-API/blob/develop/lib/endpoints/class-wp-rest-comments-controller.php#L925

@joehoyle
Copy link
Member Author

joehoyle commented Oct 6, 2016

@rachelbaker I also had to modify prepare_item_for_database to set type to an empty string in the event of comment. Turns out wp_insert_comment( [ type => 'comment' ] ) breaks things a lot!

@joehoyle
Copy link
Member Author

joehoyle commented Oct 6, 2016

@WP-API/amigos #reviewmerge

@rachelbaker rachelbaker merged commit 55fbeee into develop Oct 6, 2016
@rachelbaker rachelbaker deleted the update-comment-type-issue branch October 6, 2016 19:02
@rachelbaker rachelbaker added this to the 2.0 Beta 15 milestone Oct 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants