From 5896765533a59d0e5ae94c6ac3a40cd63b49c81e Mon Sep 17 00:00:00 2001 From: bengizmo Date: Sat, 14 Jun 2025 20:42:26 -0300 Subject: [PATCH] Fix Google Sheets API valueInputOption parameter handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move valueInputOption from JSON body to query parameter as required by Google Sheets API - Update make_api_request method to properly extract and append valueInputOption as URL parameter - Resolves 'Invalid JSON payload received. Unknown name valueInputOption' error - Google Sheets API calls now use correct parameter structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../includes/google-sheets/class-google-sheets-auth.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/google-sheets/class-google-sheets-auth.php b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/google-sheets/class-google-sheets-auth.php index 87590dff..e19e692b 100644 --- a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/google-sheets/class-google-sheets-auth.php +++ b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/includes/google-sheets/class-google-sheets-auth.php @@ -207,6 +207,12 @@ class HVAC_Google_Sheets_Auth { $base_url = ($api_type === 'drive') ? $this->drive_api_url : $this->sheets_api_url; $url = $base_url . $endpoint; + // Handle valueInputOption as query parameter for Sheets API + if ($data && isset($data['valueInputOption'])) { + $url .= '?valueInputOption=' . urlencode($data['valueInputOption']); + unset($data['valueInputOption']); // Remove from body data + } + $args = array( 'method' => $method, 'headers' => array(