- Issue created by @u_tiwari
The website encountered an unexpected error. Try again later.
TypeError: json_decode(): Argument #1 ($json) must be of type string, GuzzleHttp\Psr7\Response given in json_decode() (line 26 of core/lib/Drupal/Component/Serialization/Json.php).
Drupal\Component\Serialization\Json::decode() (Line: 130)
Drupal\zoomapi\Plugin\ApiTools\Client->postRequest() (Line: 253)
Drupal\apitools\Api\Client\ClientBase->request() (Line: 295)
Drupal\apitools\Api\Client\ClientBase->post() (Line: 393)
Just make the ZOOM API request fail by maybe entering wrong keys.
diff --git a/src/Plugin/ApiTools/Client.php b/src/Plugin/ApiTools/Client.php
index 78d9b8d..3e4517f 100644
--- a/src/Plugin/ApiTools/Client.php
+++ b/src/Plugin/ApiTools/Client.php
@@ -127,7 +127,7 @@ class Client extends ClientBase {
* {@inheritdoc}
*/
protected function postRequest($response) {
- return Json::decode($response);
+ return is_string($response) ? Json::decode($response) : $response;
}
/**
Active
3.0
Code