Skip to content
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

Add check for array key #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OfficialAudite
Copy link

This fixes the problem i mentioned for latest wordpress with php 8.3 :)

@OfficialAudite
Copy link
Author

The "working" state of acf-editor-palette

21-Oct-2024 09:31:44 UTC] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type array on array in /var/www/html/wp-content/plugins/acf-editor-palette/src/Concerns/Palette.php:48
Stack trace:
#0 /var/www/html/wp-content/plugins/acf-editor-palette/src/Field.php(248): Log1x\AcfEditorPalette\Field->palette(Array)
#1 /var/www/html/wp-includes/class-wp-hook.php(324): Log1x\AcfEditorPalette\Field->validate_value(true, Array, Array, 'acf-block_acf-b...')
#2 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(true, Array)
#3 /var/www/html/wp-content/mu-plugins/advanced-custom-fields-pro/includes/validation.php(335): apply_filters('acf/validate_va...', true, Array, Array, 'acf-block_acf-b...')
#4 /var/www/html/wp-content/mu-plugins/advanced-custom-fields-pro/pro/blocks.php(1325): acf_validate_value(Array, Array, 'acf-block_acf-b...')
#5 /var/www/html/wp-content/mu-plugins/advanced-custom-fields-pro/pro/blocks.php(1251): acf_validate_block_from_local_meta('block_acf-block...', Array, false)
#6 /var/www/html/wp-content/mu-plugins/advanced-custom-fields-pro/pro/blocks.php(595): acf_get_block_validation_state(Array, false, false, true)
#7 /var/www/html/wp-content/mu-plugins/advanced-custom-fields-pro/pro/blocks.php(533): acf_rendered_block(Array, '', true, 325, Object(WP_Block))
#8 /var/www/html/wp-includes/class-wp-block.php(463): acf_render_block_callback(Array, '', Object(WP_Block))
#9 /var/www/html/wp-includes/blocks.php(1705): WP_Block->render()
#10 /var/www/html/wp-includes/blocks.php(1743): render_block(Array)
#11 /var/www/html/wp-includes/class-wp-hook.php(324): do_blocks('<!-- wp:acf/her...')
#12 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters('<!-- wp:acf/her...', Array)
#13 /var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1865): apply_filters('the_content', '<!-- wp:acf/her...')
#14 /var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(569): WP_REST_Posts_Controller->prepare_item_for_response(Object(WP_Post), Object(WP_REST_Request))
#15 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1230): WP_REST_Posts_Controller->get_item(Object(WP_REST_Request))
#16 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/pages/(?...', Array, NULL)
#17 /var/www/html/wp-includes/rest-api.php(555): WP_REST_Server->dispatch(Object(WP_REST_Request))
#18 /var/www/html/wp-includes/rest-api.php(2922): rest_do_request(Object(WP_REST_Request))
#19 [internal function]: rest_preload_api_request(Array, '/wp/v2/pages/32...')
#20 /var/www/html/wp-includes/block-editor.php(750): array_reduce(Array, 'rest_preload_ap...', Array)
#21 /var/www/html/wp-admin/edit-form-blocks.php(77): block_editor_rest_api_preload(Array, Object(WP_Block_Editor_Context))
#22 /var/www/html/wp-admin/post.php(187): require('/var/www/html/w...')
#23 {main}
  thrown in /var/www/html/wp-content/plugins/acf-editor-palette/src/Concerns/Palette.php on line 48

This fixes it 👍🏻

@OfficialAudite OfficialAudite mentioned this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants