-
Notifications
You must be signed in to change notification settings - Fork 68
Send function error after upgrade to 4.1.2 #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I also get the same error. I fixed version to 4.1.1. I will revert back when bug will fixes p.s "$email->jsonSerialize()" did not fix the error. |
Fwiw sendgrid/sendgrid-php#1123 would fix this error but there are a few ones that also surfaced with the new types for Something like this patch should fix the issue from this side until there's a better solution: From ac2921664ac1ce0e49501c17a71d8da7949c41a5 Mon Sep 17 00:00:00 2001
From: Matias Yocca <[email protected]>
Date: Tue, 8 Apr 2025 15:05:53 -0300
Subject: [PATCH] fix: cast body and query params to array
---
lib/Client.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Client.php b/lib/Client.php
index 375d059..886bec4 100644
--- a/lib/Client.php
+++ b/lib/Client.php
@@ -645,8 +645,8 @@ class Client
}
if (\in_array($name, $this->methods, true)) {
- $body = isset($args[0]) ? $args[0] : null;
- $queryParams = isset($args[1]) ? $args[1] : null;
+ $body = isset($args[0]) ? (array)$args[0] : null;
+ $queryParams = isset($args[1]) ? (array)$args[1] : null;
$url = $this->buildUrl($queryParams);
$headers = isset($args[2]) ? $args[2] : null;
$retryOnLimit = isset($args[3]) ? $args[3] : $this->retryOnLimit;
--
2.48.1
I didn't have a chance to test this yet since it would need to be tested e2e with both packages and the applied patch. Tagging @twilio-dx since this is currently breaking all new sdk installs. |
Hi! We are working on this. Will be releasing the fixed version at the earliest |
Hi, I just upgraded from version 4.1.1 to 4.1.2 and noticed that the send function is erroring because of the new type declarations introduced in this version.
Something like this is no longer working.
The error it shows says:
The text was updated successfully, but these errors were encountered: