Fatal error creating new page or post with PHP8.0
-
As I activate the plugin and try to create a new page or post, I get a crytical errot and php log says:
PHP Fatal error: Uncaught TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given in /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php:1436 Stack trace: #0 /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php(1436): array_intersect_key('O:27:"Ankit\\WCS...', Array) #1 /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php(1358): WP_REST_Server->get_data_for_route('/wcssc/v1/get-l...', Array, 'view') #2 /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php(1224): WP_REST_Server->get_data_for_routes(Array, 'view') #3 /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php(1140): WP_REST_Server->get_index(Object(WP_REST_Request)) #4 /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php(987): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/', Array, NULL) #5 /home/xxxxxx/public_html/wp-includes/rest-api.php(495): WP_REST_Server->dispatch(Object(WP_REST_Request)) #6 /home/xxxxxx/public_html/wp-includes/rest-api.php(2832): rest_do_request(Object(WP_REST_Request)) #7 [internal function]: rest_preload_api_request(Array, '/') #8 /home/xxxxxx/public_html/wp-includes/block-editor.php(444): array_reduce(Array, 'rest_preload_ap...', Array) #9 /home/xxxxxx/public_html/wp-admin/edit-form-blocks.php(68): block_editor_rest_api_preload(Array, Object(WP_Block_Editor_Context)) #10 /home/xxxxxx/public_html/wp-admin/post-new.php(72): require('/home/xxxxxx/...') #11 {main} thrown in /home/xxxxxx/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1436
It is a brand new installation of WP and If I enable only woocommerce and this plugin, with default theme, I still get the error.
While if I change the server php version from 8.0 to 7.4, it starts working.
Any solution?
Thanks
- The topic ‘Fatal error creating new page or post with PHP8.0’ is closed to new replies.