-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
REST API Write access - Fix invalid default value #7339
REST API Write access - Fix invalid default value #7339
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc0ttkclark This is throughout the whole array, want me to fix or leave as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_all
option of a Pod was set to the Pod name. This results in incorrect parsing of a boolean inPodsRESTFields::field_allowed_to_extend()
inwrite
mode.@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