REST API Write access - Fix invalid default value#7339
REST API Write access - Fix invalid default value#7339sc0ttkclark merged 3 commits intorelease/3.2.7from
Conversation
PR Summary
|
| 'help' => __( 'Allow all fields to be updated via the REST API. If unchecked fields must be enabled on a field by field basis.', 'pods' ), | ||
| 'type' => 'boolean', | ||
| 'default' => '', | ||
| 'depends-on' => [ 'rest_enable' => true, 'read_all' => true ], |
There was a problem hiding this comment.
[phpcs] reported by reviewdog 🐶WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
There was a problem hiding this comment.
@sc0ttkclark This is throughout the whole array, want me to fix or leave as is?
There was a problem hiding this comment.
The phpcs stuff is just optional to fix. Autoformat can help but it's file by file as we're able to.
Signed-off-by: Jory Hogeveen <[email protected]>
Signed-off-by: Jory Hogeveen <[email protected]>
|
Added backcompat handling but did not include a DB migration. |
3293a10 to
55fa1a1
Compare
Description
De default value for the
write_alloption of a Pod was set to the Pod name. This results in incorrect parsing of a boolean inPodsRESTFields::field_allowed_to_extend()inwritemode.@sc0ttkclark See testing instructions. I'm not sure how you would like to implement something that will repair old Pods. You could check for
! empty()instead of usingfilter_var()but that might not be desirable.Related GitHub issue(s)
Fixes #7327
Testing instructions
PodsRESTFields::field_allowed_to_extend()and dump$all_fields_can_use_mode. It will return false, allways.$pod->get_arg( $pod_mode_arg, 'value_not_set' )and see it returns the Pod name instead of a 1 or 0.PR checklist