headless-cms icon indicating copy to clipboard operation
headless-cms copied to clipboard

Uncaught TypeError: Headless_CMS\Features\Inc\Api\Wc_States::get_formatted_states()

Open MrJoshFisher opened this issue 7 months ago • 0 comments

Getting the following error when making a GET request to /wp-json/rae/v1/wc/states?countryCode=AW

Fatal error: Uncaught TypeError: Headless_CMS\Features\Inc\Api\Wc_States::get_formatted_states(): Argument #1 ($states) must be of type array, bool given, called in /public_html/wp-content/plugins/headless-cms-master/inc/classes/api/class-wc-states.php on line 93 and defined in /public_html/wp-content/plugins/headless-cms-master/inc/classes/api/class-wc-states.php:114 Stack trace: #0 /public_html/wp-content/plugins/headless-cms-master/inc/classes/api/class-wc-states.php(93): Headless_CMS\Features\Inc\Api\Wc_States->get_formatted_states(false) #1 /public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): Headless_CMS\Features\Inc\Api\Wc_States->get_states(Object(WP_REST_Request)) #2 /public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/rae/v1/wc/stat...', Array, NULL) #3 /public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request)) #4 /public_html/wp-includes/rest-api.php(459): WP_REST_Server->serve_request('/rae/v1/wc/stat...') #5 /public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP)) #6 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #8 /public_html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array) #9 /public_html/wp-includes/class-wp.php(818): WP->parse_request('') #10 /public_html/wp-includes/functions.php(1342): WP->main('') #11 /public_html/wp-blog-header.php(16): wp() #12 /public_html/index.php(17): require('/p...') #13 {main} thrown in /public_html/wp-content/plugins/headless-cms-master/inc/classes/api/class-wc-states.php on line 114

MrJoshFisher avatar Jun 18 '25 11:06 MrJoshFisher