Skip to content

Commit

Permalink
Fix bug where object_type was not required for edit/delete requests (…
Browse files Browse the repository at this point in the history
…it should be)
  • Loading branch information
jtsternberg committed Sep 8, 2016
1 parent 9f46758 commit f9bde33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/CMB2_REST_Controller_Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function delete_field_value( $request ) {
*/
public function modify_field_value( $activity, $field ) {

if ( ! $this->request['object_id'] && ! $this->request['object_type'] ) {
if ( ! $this->request['object_id'] || ! $this->request['object_type'] ) {
return new WP_Error( 'cmb2_rest_modify_field_value_error', __( 'CMB2 Field value cannot be modified without the object_id and object_type parameters specified.', 'cmb2' ), array( 'status' => 400 ) );
}

Expand Down

0 comments on commit f9bde33

Please sign in to comment.