New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BC Break with Post Meta Handling in Post Routes #474

Merged
merged 8 commits into from Mar 14, 2015

Conversation

Projects
None yet
2 participants
@rachelbaker
Member

rachelbaker commented Sep 8, 2014

During the split of the meta handling into it's own classes (#358) we broke documented functionality, including:

  1. Allowing post_meta creation when creating a new post.
  2. Allowing post_meta actions (add/edit/delete) when editing an existing post.
  3. Returning post_meta values within the response for a post.

Additional unit tests needed here to make sure all edge cases are working as expected.

Originally identified by @tlovett1.

@rachelbaker rachelbaker added the Bug label Sep 8, 2014

@rachelbaker

This comment has been minimized.

Show comment
Hide comment
@rachelbaker

rachelbaker Sep 8, 2014

Member

@rmccue #reviewmerge

Member

rachelbaker commented Sep 8, 2014

@rmccue #reviewmerge

@rachelbaker rachelbaker added the Review label Sep 9, 2014

@rmccue rmccue added this to the 1.2 milestone Sep 12, 2014

@@ -714,6 +714,7 @@ protected function prepare_post( $post, $context = 'view' ) {
'content_raw' => $post['post_content'],
'excerpt_raw' => $post['post_excerpt'],
'guid_raw' => $post['guid'],
+ 'post_meta' => $this->handle_get_post_meta( $post['ID'] ),

This comment has been minimized.

@rmccue

rmccue Sep 12, 2014

Member

Hmm, I thought this was handled by filters...

@rmccue

rmccue Sep 12, 2014

Member

Hmm, I thought this was handled by filters...

This comment has been minimized.

@rachelbaker

rachelbaker Sep 13, 2014

Member

@rmccue A similar line of code existed prior to the splitting of the meta changes. I will confirm this is extraneous and not needed.

@rachelbaker

rachelbaker Sep 13, 2014

Member

@rmccue A similar line of code existed prior to the splitting of the meta changes. I will confirm this is extraneous and not needed.

This comment has been minimized.

@rachelbaker

rachelbaker Sep 19, 2014

Member

@rmccue I don't see a filter that handles adding post_meta for $context = 'edit' requests to the /post/ routes. You removed the following line in e55c8a6:

'post_meta' => $this->get_all_meta( $post['ID'] ),

Full diff: e55c8a6#diff-47410674040d782fa9d1a8455c33a7deL725

Maybe you intended to handle this with a filter?

@rachelbaker

rachelbaker Sep 19, 2014

Member

@rmccue I don't see a filter that handles adding post_meta for $context = 'edit' requests to the /post/ routes. You removed the following line in e55c8a6:

'post_meta' => $this->get_all_meta( $post['ID'] ),

Full diff: e55c8a6#diff-47410674040d782fa9d1a8455c33a7deL725

Maybe you intended to handle this with a filter?

@rmccue rmccue removed the Has Patch label Nov 5, 2014

rachelbaker added a commit that referenced this pull request Mar 14, 2015

Merge pull request #474 from WP-API/fix-post-meta-handling
Fix BC Break with Post Meta Handling in Post Routes

@rachelbaker rachelbaker merged commit fcb7d57 into master Mar 14, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@rachelbaker

This comment has been minimized.

Show comment
Hide comment
@rachelbaker

rachelbaker Mar 14, 2015

Member

merged #474

Member

rachelbaker commented Mar 14, 2015

merged #474

@rachelbaker rachelbaker deleted the fix-post-meta-handling branch Mar 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment