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

Not working #65

Closed
OfficialAudite opened this issue Oct 21, 2024 · 4 comments
Closed

Not working #65

OfficialAudite opened this issue Oct 21, 2024 · 4 comments

Comments

@OfficialAudite
Copy link

Seems that it does not work with latest wordpress & php versions...

@Log1x
Copy link
Owner

Log1x commented Oct 21, 2024

It absolutely does. Make sure you're downloading the actual built release at https://github.com/Log1x/acf-editor-palette/releases/tag/v1.2.0 (e.g. acf-editor-palette-v1.2.0.zip) and not the source code.

In the future, try to include more information when posting issues.

@Log1x Log1x closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
@OfficialAudite
Copy link
Author

OfficialAudite commented Oct 21, 2024

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

Well it does not work. There for here is a fix: #66

@Log1x
Copy link
Owner

Log1x commented Oct 21, 2024

You're going to have to provide more info then. When does the exception occur? Is this during validation? Your stack trace is hinting towards it. Perhaps something popping up now that block validation works in ACF Pro? How are you configuring your theme's editor palette?

Does your PR actually fix this and otherwise work as intended? The palette is already casted to an array as well as checked if empty– the existing null coalescing should seemingly be fine.

I'm sorry for closing this immediately, but your original issue gave absolutely zero details and this plugin has seen a good amount of installs/usage to not have any prior reports.

@OfficialAudite
Copy link
Author

OfficialAudite commented Oct 21, 2024

This happens when trying to edit a page. Everything worked prior to 8.3 php. And yes I've tried in clients system with the fix and it works correctly. So aka, if I want to edit a page and the page has blocks that use palette. So when clicking on edit button for page in wp-admin redirects you to guthenberg editor. In this case it just throws error.

I thought that too, that the casts and ?? null check should be working but php 8.3 is amazing at not letting anything trough.

Is ok, sorry for bad message. It's monday and I'm just tired :D

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

No branches or pull requests

2 participants