Fatal error: Uncaught TypeError: unserialize(): Argument #1 ($data)
-
Hi, I have a problem with one of the plugins. With Docket Cache enabled, i got error:
Fatal error: Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, OauthResultClientCredentials given in /path/to/file/wp-content/plugins/woo-payu-payment-gateway/Payu/Cache/OauthCache.php:10A here is this part of file OauthCache.php:
public function get( $key ) {
$cache = get_transient( $key ); // line 8
return $cache === false ? null : unserialize( $cache ); // line 10
}With Docket Cache enabled, in line 8 get_transient( $key ); returns object OauthResultClientCredentials, so in $cache variable we have this object, but in line 10, string is expected (in $cache) as input for unserialize(…) method.
Without Docket Cache, everything is ok, because in database string is stored for this key (serialized object stored as string).So, I think get_transient() should return string in both case.
I can fix it with setup:
Retain Transients in Db: Enable – but what does it mean? Does it mean that transients are not optimized?
The topic ‘Fatal error: Uncaught TypeError: unserialize(): Argument #1 ($data)’ is closed to new replies.