We are using the Google Drive API for PHP in our web application, and although listing, inserting and deleting work just fine, we keep getting these warnings when using the list()
method:
$google_return = $GoogleAPI['Drive']->files->list();
causes these two warnings to appear:
Warning: Invalid argument supplied for foreach() in (...)lib/php/GOOGLE/service/Google_ServiceResource.php on line 108
Warning: Invalid argument supplied for foreach() in (...)lib/php/GOOGLE/io/Google_REST.php on line 92
I tried modifying the API files themselves and added an is_array
check before that foreach, to no avail.
Any ideas?
Thanks!
EDIT: The client API is downloaded from here http://code.google.com/p/google-api-php-client/
The below code causes a warning, so I added the is_array
check but that didn't eliminate it.
$method['parameters'] = array_merge($method['parameters'], $this->stackParameters);
if (is_array ($parameters) {
foreach ($parameters as $key => $val) {
if ($key != 'postBody' && ! isset($method['parameters'][$key])) {
throw new Google_Exception("($name) unknown parameter: '$key'");
}
}
}