AdvancedCustomFields / AdvancedCustomFields/acf
Checkbox field gets a PHP E_NOTICE for a missing 'multiple' index in the $field array.
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hey @elliotcondon
Recently I've updated the ACF PRO from 5.8.9 to 5.8.11 and started to get the E_NOTICE when I'm trying to create a checkbox.
The $field is missing a multiple index
Specs:
- PHP: 7.2
- WP: 5.4.1
- ACF: 5.8.11
The stack trace of the error is the following:
ErrorException thrown with message "Undefined index: multiple"
Stacktrace:
#17 ErrorException in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-select.php:492
#16 Themosis\Core\Bootstrap\ExceptionHandler:handleError in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-select.php:492
#15 acf_field_select:update_field in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-checkbox.php:445
#14 acf_field_checkbox:update_field in /pathToProject/htdocs/cms/wp-includes/class-wp-hook.php:287
#13 WP_Hook:apply_filters in /pathToProject/htdocs/cms/wp-includes/plugin.php:249
#12 apply_filters_ref_array in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/acf-hook-functions.php:101
#11 _acf_apply_hook_variations in /pathToProject/htdocs/cms/wp-includes/class-wp-hook.php:287
#10 WP_Hook:apply_filters in /pathToProject/htdocs/cms/wp-includes/plugin.php:206
#9 apply_filters in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/acf-field-functions.php:971
#8 acf_update_field in /pathToProject/htdocs/content/mu-plugins/advanced-custom-fields-pro/includes/admin/admin-field-group.php:488
#7 acf_admin_field_group:save_post in /pathToProject/htdocs/cms/wp-includes/class-wp-hook.php:289
#6 WP_Hook:apply_filters in /pathToProject/htdocs/cms/wp-includes/class-wp-hook.php:311
#5 WP_Hook:do_action in /pathToProject/htdocs/cms/wp-includes/plugin.php:478
#4 do_action in /pathToProject/htdocs/cms/wp-includes/post.php:4153
#3 wp_insert_post in /pathToProject/htdocs/cms/wp-includes/post.php:4244
#2 wp_update_post in /pathToProject/htdocs/cms/wp-admin/includes/post.php:409
#1 edit_post in /pathToProject/htdocs/cms/wp-admin/post.php:227
#0 require in ~/.composer/vendor/laravel/valet/server.php:158
The Content of that $field:
array:1 [▼
"field" => array:24 [▼
"ID" => 13026
"key" => "field_5ecb95ae4f017"
"label" => "Checkbox Test"
"name" => "testing"
"prefix" => ""
"type" => "checkbox"
"value" => null
"menu_order" => 0
"instructions" => ""
"required" => 0
"id" => ""
"class" => ""
"conditional_logic" => 0
"parent" => 13025
"wrapper" => array:3 [▶]
"choices" => array:2 [▼
1 => "CheckBox"
2 => "Select"
]
"allow_custom" => 0
"default_value" => []
"layout" => "vertical"
"toggle" => 0
"return_format" => "value"
"_name" => "testing"
"_valid" => 1
"save_custom" => 0
]
]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at includes/fields/class-acf-field-select.php:492 and follow the update_field call from includes/fields/class-acf-field-checkbox.php:445. Reproduce saving the checkbox field with the shown $field data, then verify the missing multiple index no longer produces an E_NOTICE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100