Fatal error when searching custom post type
-
Hello,
I just installed the plugin, it works fine on a search with the custom post type “post”, but it causes a fatal error as soon as I want to search on another post type (already registered for indexing in the Relevanssi settings and works with a simple WP_Query). Here is the error in the logs:
PHP Fatal error: Uncaught Error: Call to a member function prepare_item_for_response() on null in /home/web/public_html/wp-content/plugins/rest-api-for-relevanssi/rest-api-for-relevanssi.php:206
Stack trace:
0 /home/web/public_html/wp-includes/rest-api/class-wp-rest-server.php(1171): rest_api_plugin_for_relevanssi->relevanssi_search_callback(Object(WP_REST_Request))
1 /home/web/public_html/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/relevanssi/v1/…', Array, NULL)
2 /home/web/public_html/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
3 /home/web/public_html/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/relevanssi/v1/…')
4 /home/web/public_html/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
5 /home/web/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
6 in /home/web/public_html/wp-content/plugins/rest-api-for-relevanssi/rest-api-for-relevanssi.php on line 206
- The topic ‘Fatal error when searching custom post type’ is closed to new replies.