Vote > Fatal error
-
Hey,
when inserting a vote by a resuable block, the back- and frontend crashes with this error:
…/wp-content/plugins/poll-creator-pro/build/vote/render.php
Fatal error: Uncaught Error: Call to undefined method WP_Error::get_results() in …/wp-content/plugins/poll-creator-pro/build/vote/render.php:69 Stack trace: #0 …/wp-includes/blocks.php(552): require() #1 …/wp-includes/class-wp-block.php(586): {closure}() #2 …/wp-includes/class-wp-block.php(566): WP_Block->render() #3 …/wp-includes/class-wp-block.php(566): WP_Block->render() #4 …/wp-includes/blocks.php(2359): WP_Block->render() #5 …/wp-includes/blocks.php(2431): render_block() #6 …/wp-includes/class-wp-hook.php(324): do_blocks() #7 …/wp-includes/plugin.php(205): WP_Hook->apply_filters() #8 …/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php(652): apply_filters() #9 …/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php(460): WP_REST_Revisions_Controller->prepare_item_for_response() #10 …/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php(318): WP_REST_Autosaves_Controller->prepare_item_for_response() #11 …/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Autosaves_Controller->get_items() #12 …/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request() #13 …/wp-includes/rest-api.php(586): WP_REST_Server->dispatch() #14 …/wp-includes/rest-api.php(2973): rest_do_request() #15 [internal function]: rest_preload_api_request() #16 …/wp-includes/block-editor.php(754): array_reduce() #17 …/wp-admin/edit-form-blocks.php(114): block_editor_rest_api_preload() #18 …/wp-admin/post.php(187): require(‘/usr/www/users/…’) #19 {main} thrown in …/wp-content/plugins/poll-creator-pro/build/vote/render.php on line 69
That error occurs, when the original vote record has been deleted (but the reusable refers to it). There is some error checking required, if the given pollClientId is valid (existing) and the object from that also has eg $feedback->get_yes_icon
You must be logged in to reply to this topic.